Project

General

Profile

Actions

Bug #17408

closed

Fiber.backtrace returns [] when unavailable, unlike Thread

Added by zverok (Victor Shepelev) over 3 years ago. Updated over 3 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:101530]

Description

t = Thread.new{}
p t.backtrace
# => nil

f = Fiber.new{}
p f.backtrace
# => []

It seems inconsistent, is this intentional?

Ping @ioquatix (Samuel Williams)

Actions #1

Updated by marcandre (Marc-Andre Lafortune) over 3 years ago

Good catch.

@ioquatix (Samuel Williams) confirms it should be nil and is looking into it.

I'll update the doc.

Actions #2

Updated by Anonymous over 3 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) over 3 years ago

should be nil

when the fiber is dead.

Updated by marcandre (Marc-Andre Lafortune) over 3 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

Also available in: Atom PDF

Like0
Like0Like0Like0Like0