Bug #9937

Segfault in the TracePoint API

Added by David Rodríguez over 2 years ago. Updated almost 2 years ago.

ruby -v:
ruby 2.2.0dev (2014-06-12 trunk 46413) [i686-linux]



It seems that a regression bug has been recently introduced in the TracePoint API (maybe after changeset r45758). byebug's test suite works against 2.0 and 2.1, but segfaults against ruby-head. See

Segfault occurs in, I'm guessing the method ID provided by the TracePoint API is nil, so the SYM2ID call fails.

I'm sorry I'm not currently able to properly investigate this.


#1 [ruby-core:63183] Updated by David Rodríguez over 2 years ago

Hi @ko1, I see that you made some changes in the TracePoint API, but the build is still segfaulting at the same place. Just to confirm this is still an issue.


#2 [ruby-core:63325] Updated by David Rodríguez over 2 years ago


Similar update: after latest bug fixes in the API (#9957, #9959, #9961, #9964), the build still segfaults in the same place.

By the way, thanks for all the recent work and bug fixes in the TracePoint API!!

#3 [ruby-core:64131] Updated by Tomoyuki Chikanaga about 2 years ago

  • Status changed from Open to Assigned

Thank you for your report.

ko1 san, could you handle this issue?

#4 [ruby-core:64141] Updated by David Rodríguez about 2 years ago

Hi, I'll be fixing this inside byebug. I don't think the assumption that TracePoint API events will always provide a method_id is correct, so I'll be checking for nil values.

I guess this can be closed.

#5 [ruby-core:66527] Updated by Koichi Sasada almost 2 years ago

sorry for late.

Can you make small test for it? easy to keep away from this issue, but it should be fixed.

#6 [ruby-core:66580] Updated by David Rodríguez almost 2 years ago

Hi Koichi, I've revisited this. This is not a bug in the TracePoint API. it was a bug in Byebug. I was using the same callback for the RUBY_EVENT_B_CALL, RUBY_EVENT_CLASS and RUBY_EVENT_CALL, but only the RUBY_EVENT_CALL provides a method_id, so the other events were failing when trying to grab the method_id.

The issue can be closed.

#7 [ruby-core:66605] Updated by Koichi Sasada almost 2 years ago

  • Status changed from Assigned to Closed

Ah, I see.

You can't get method_id for top level., :b_call){|tp|
  p [tp.event, tp.method_id]
class C; end
def foo; 1.times{}; end; foo

ruby 2.2.0dev (2014-11-27 trunk 48608) [i386-mswin32_110]
[:b_call, nil]
[:class, nil]
[:b_call, :foo]

Also available in: Atom PDF