Issue #18031 has been reported by alanwu (Alan Wu).

----------------------------------------
Bug #18031: Nested TracePoint#enable with target crashes
https://bugs.ruby-lang.org/issues/18031

* Author: alanwu (Alan Wu)
* Status: Open
* Priority: Normal
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
Found this crash while looking at tracing related code.
Haven't had time to dig deeper, so I'm making a ticket for now.

```ruby
one = TracePoint.new(:call) {}
two = TracePoint.new(:call) {}

obj = Object.new
obj.define_singleton_method(:foo) {} # a bmethod

foo = obj.method(:foo)
one.enable(target: foo) do
  two.enable(target: foo) {}
end
```

It crashes on 2.6.5 and master (a7c85cc).



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>