Project

General

Profile

Actions

Bug #18031

open

Nested TracePoint#enable with define_method target crashes

Added by alanwu (Alan Wu) 4 months ago. Updated 3 months ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:104548]

Description

Found this crash while looking at tracing related code.
Haven't had time to dig deeper, so I'm making a ticket for now.

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).

Actions

Also available in: Atom PDF