Bug #11492
closedTracePoint API report extra return for defined method
Description
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
Updated by os97673 (Oleg Sukhodolsky) about 9 years ago
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
Updated by nagachika (Tomoyuki Chikanaga) about 9 years ago
- Status changed from Open to Assigned
- Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED
Updated by ko1 (Koichi Sasada) about 9 years ago
- Status changed from Assigned to Closed
Applied in changeset r51713.
- vm.c (hook_before_rewind): prevent kicking :return event while
finishing vm_exec func because invoke_block_from_c() kick a :return
event for bmethods.
[Bug #11492] - test/ruby/test_settracefunc.rb: add a test.
Updated by deivid (David Rodríguez) about 9 years ago
Oleg, could you link to the original report where you found this out? I'd like to know what kind of bug reports to expect and maybe add a regression test in byebug itself.
Updated by os97673 (Oleg Sukhodolsky) about 9 years ago
David Rodríguez wrote:
Oleg, could you link to the original report where you found this out? I'd like to know what kind of bug reports to expect and maybe add a regression test in byebug itself.
originally the problem was reported here (https://youtrack.jetbrains.com/issue/RUBY-17051) unfortunately user was unable to provide test and I've investigated the problem using log of event reported by debase
Updated by os97673 (Oleg Sukhodolsky) about 9 years ago
Reporter of original bug confirmed that ruby-head does fix the problem.
Updated by nagachika (Tomoyuki Chikanaga) about 9 years ago
- Backport changed from 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONE
Backported into ruby_2_2
branch at r52308.
Updated by deivid (David Rodríguez) about 9 years ago
Hi, this is indeed a regression in 2.2.3, but also a bug present in 2.1.7. Could we get it backported to 2.1 as well? Thanks!
Updated by usa (Usaku NAKAMURA) about 9 years ago
- Backport changed from 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONE to 2.0.0: DONTNEED, 2.1: REQUIRED, 2.2: DONE
Updated by usa (Usaku NAKAMURA) about 9 years ago
- Related to Backport #11646: Please backport r51713 added
Updated by usa (Usaku NAKAMURA) almost 9 years ago
- Backport changed from 2.0.0: DONTNEED, 2.1: REQUIRED, 2.2: DONE to 2.0.0: DONTNEED, 2.1: DONE, 2.2: DONE
ruby_2_1 r52639 merged revision(s) 51713.