Actions
Bug #17408
closedFiber.backtrace returns [] when unavailable, unlike Thread
    Bug #17408:
    Fiber.backtrace returns [] when unavailable, unlike Thread
  
Description
t = Thread.new{}
p t.backtrace
# => nil
f = Fiber.new{}
p f.backtrace
# => []
It seems inconsistent, is this intentional?
        
           Updated by marcandre (Marc-Andre Lafortune) almost 5 years ago
          Updated by marcandre (Marc-Andre Lafortune) almost 5 years ago
          
          
        
        
      
      Good catch.
@ioquatix (Samuel Williams) confirms it should be nil and is looking into it.
I'll update the doc.
        
           Updated by Anonymous almost 5 years ago
          Updated by Anonymous almost 5 years ago
          
          
        
        
      
      - Status changed from Open to Closed
Applied in changeset git|d0050edb84e9c3ba99946e08325e168deb741e28.
Update Fiber#backtrace doc [See bug #17408]
        
           Updated by ioquatix (Samuel Williams) almost 5 years ago
          Updated by ioquatix (Samuel Williams) almost 5 years ago
          
          
        
        
      
      should be nil
when the fiber is dead.
        
           Updated by marcandre (Marc-Andre Lafortune) almost 5 years ago
          Updated by marcandre (Marc-Andre Lafortune) almost 5 years ago
          
          
        
        
      
      ioquatix (Samuel Williams) wrote in #note-3:
should be nil
when the fiber is dead.
Right. Doc does call resume but not this issue. Correct code should read:
f = Fiber.new{}
f.resume
f.backtrace # => currently [] (should be nil)
Actions