[#111712] [Ruby master Feature#19322] Support spawning "private" child processes — "kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core" <ruby-core@...>
SXNzdWUgIzE5MzIyIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGtqdHNhbmFrdHNpZGlzIChLSiBUc2Fu
14 messages
2023/01/07
[ruby-core:112059] [Ruby master Misc#19382] (please close) Infinite loop in tracepoints when calling `pp`
From:
"luke-gru (Luke Gruber) via ruby-core" <ruby-core@...>
Date:
2023-01-26 20:56:11 UTC
List:
ruby-core #112059
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/
______________________________________________
ruby-core mailing list -- [email protected]
To unsubscribe send an email to [email protected]
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/