Project

General

Profile

Actions

Bug #18060

closed

Infinite loop when b_return TracePoint raises

Added by alanwu (Alan Wu) about 1 year ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:104767]

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

Actions #1

Updated by alanwu (Alan Wu) 3 months ago

  • Description updated (diff)
Actions #2

Updated by alanwu (Alan Wu) 3 months ago

  • 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]

Actions

Also available in: Atom PDF