Bug #18060
closed
Infinite loop when b_return TracePoint raises
Added by alanwu (Alan Wu) over 3 years ago.
Updated over 2 years ago.
Description
The following program loops indefinitely:
puts("PID: #{$$}")
class Foo
define_singleton_method(:foo) { return }
end
counter = 0
TracePoint.trace(:b_return) do |tp|
$stdout.write(counter, ' ', tp.inspect, "\r")
counter += 1
raise
end
Foo.foo
It doesn't seem intentional that this loops.
Fix: https://github.com/ruby/ruby/pull/4638
- Description updated (diff)
- Status changed from Open to Closed
Applied in changeset git|744d17ff6c33b09334508e8110007ea2a82252f5.
Fix infinite loop when b_return TracePoint throws
Previously, we didn't pop the frame that runs the TracePoint hook for
b_return events for blocks running as methods (bmethods). In case the
hook raises, that formed an infinite loop during stack unwinding in
hook_before_rewind().
[Bug #18060]
Also available in: Atom
PDF
Like0
Like0Like0