Bug #9937


Segfault in the TracePoint API

Added by deivid (David Rodríguez) about 8 years ago. Updated over 7 years ago.

Target version:
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.

Updated by deivid (David Rodríguez) about 8 years ago

Hi @ko1 (Koichi Sasada), 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.


Updated by deivid (David Rodríguez) about 8 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!!

Updated by nagachika (Tomoyuki Chikanaga) almost 8 years ago

  • Status changed from Open to Assigned

Thank you for your report.

ko1 san, could you handle this issue?

Updated by deivid (David Rodríguez) almost 8 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.

Updated by ko1 (Koichi Sasada) over 7 years ago

sorry for late.

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

Updated by deivid (David Rodríguez) over 7 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.

Updated by ko1 (Koichi Sasada) over 7 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