
Issue #19382 has been updated by luke-gru (Luke Gruber). Tracker changed from Bug to Misc Subject changed from Infinite loop in tracepoints where called method comes from evaled code to (please close) Infinite loop in tracepoints when calling `pp` Backport deleted (2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN) Nevermind, this is a weird case that using `pp` traverses the `events` and it calls methods which hook into the tracepoint, which appends to the list, and then pp does the same all over again. Just a recursive bug in my code, not in Ruby itself. ---------------------------------------- Misc #19382: (please close) Infinite loop in tracepoints when calling `pp` https://bugs.ruby-lang.org/issues/19382#change-101494 * Author: luke-gru (Luke Gruber) * Status: Open * Priority: Normal ---------------------------------------- ```ruby events = [] meth_name = "mymethod" code = <<~RUBY def #{meth_name}(); true; end RUBY eval(code, binding, 'my_location') tracepoint = TracePoint.new(:line) { |tp| events << tp.path # infinite loop here }.tap(&:enable) send("#{meth_name}") pp events ``` -- https://bugs.ruby-lang.org/