Last active
July 23, 2019 13:24
-
-
Save joker1007/cd7ca5c9933aa020bd5d6bde846d3b6f to your computer and use it in GitHub Desktop.
segv with debug_inspector and tracepoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "debug_inspector" | |
class Foo | |
def meth1(&block) | |
RubyVM::DebugInspector.open do |dc| | |
iseq = dc.frame_iseq(2) | |
trace = TracePoint.new(:b_return) do |tp| | |
pp tp | |
tp.disable | |
end | |
trace.enable(target: iseq) | |
end | |
end | |
def meth2 | |
Object.new.tap do |_| | |
meth1 | |
meth1 | |
end | |
GC.start | |
GC.start | |
end | |
end | |
Foo.new.meth2 |
Author
joker1007
commented
Jul 23, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment