[#70257] [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI — ko1@...

Issue #11420 has been reported by Koichi Sasada.

11 messages 2015/08/06

[ruby-core:70609] [Ruby trunk - Bug #11492] TracePoint API report extra return for defined method

From: os97673@...
Date: 2015-08-27 19:48:56 UTC
List: ruby-core #70609
Issue #11492 has been updated by Oleg Sukhodolsky.


MRI 2.2.3 introduced problem with TracePoint events.
For the provided test it reports extra return event for method1

~~~
  b_call               ruby-17051.rb:14
    line               ruby-17051.rb:15
    call       method1 ruby-17051.rb:2 
  b_call       method1 ruby-17051.rb:2 
    line       method1 ruby-17051.rb:4 
b_return       method1 ruby-17051.rb:4 
  return       method1 ruby-17051.rb:4 
  return       method1 ruby-17051.rb:15
b_return               ruby-17051.rb:16
~~~

while 2.2.2 reports

~~~
  b_call               ruby-17051.rb:14
    line               ruby-17051.rb:15
    call       method1 ruby-17051.rb:2 
  b_call       method1 ruby-17051.rb:2 
    line       method1 ruby-17051.rb:4 
b_return       method1 ruby-17051.rb:4 
  return       method1 ruby-17051.rb:15
b_return               ruby-17051.rb:16
~~~

This breaks calculation of frame stack's size which is used in debase and byebug

----------------------------------------
Bug #11492: TracePoint API report extra return for defined method
https://bugs.ruby-lang.org/issues/11492#change-54015

* Author: Oleg Sukhodolsky
* Status: Open
* Priority: Normal
* Assignee: Koichi Sasada
* ruby -v: ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
~~~ruby
class A
  define_method "method1" do
    # puts "#{method_name}(#{arg})"
    return 1
  end
end

a = A.new

TracePoint.new do |tp|
  printf "%8s %13s %s:%-2d\n", tp.event, tp.method_id, tp.path, tp.lineno
end.enable do
  a.method1
end
~~~



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

In This Thread

Prev Next