Bug #10724
closed[TracePointAPI] Missing return event from initialize method when using `domain_name` gem
Description
The domain_name gem defines a DomainName object which has a pretty complex initialize
method. The TracePoint API misses the return event from this method when instantiating a DomainName object.
I attach a failing test case.
Thanks!!
Files
Updated by deivid (David Rodríguez) almost 10 years ago
- File test_for_issue_10724.rb test_for_issue_10724.rb added
Hi again, I've been able to reduce this to the following minimal program which misses the return
event for the initialize
call. Attaching a failing test case.
class A
def initialize
loop { return }
end
end
A.new
Thanks!!
Updated by ko1 (Koichi Sasada) almost 10 years ago
- Assignee set to ko1 (Koichi Sasada)
Thank you. I can reproduce it.
class A
def initialize
loop{return}
end
def foo
loop { return }
end
def bar
end
end
TracePoint.new(:return){|tp|
p tp
}.enable{
a = A.new
a.foo
a.bar
}
# #<TracePoint:return `foo'@t.rb:8>
# #<TracePoint:return `bar'@t.rb:12>
Updated by deivid (David Rodríguez) almost 10 years ago
Great!
Updated by deivid (David Rodríguez) over 9 years ago
@ko1 (Koichi Sasada), any updates?
Thanks!
Updated by deivid (David Rodríguez) over 9 years ago
@ko1 (Koichi Sasada), is this in your plans? Just asking so that I can find some time myself to have a look at it if you don't want or don't have the time to do it.
Updated by ko1 (Koichi Sasada) over 9 years ago
- % Done changed from 0 to 100
- Status changed from Open to Closed
Applied in changeset r50206.
- vm.c (vm_exec): check other events when RETURN is thrown.
[Bug #10724] - test/ruby/test_settracefunc.rb: add a test.
Updated by ko1 (Koichi Sasada) over 9 years ago
- Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: REQUIRED
Sorry for long absent.
I fixed it.
Idea is given by wanabe-san.
https://twitter.com/wannabe53/status/578555803445035009
Updated by deivid (David Rodríguez) over 9 years ago
Great! Thanks a lot to both for the fix.
I'd like this backported to 2.0 and 2.1, too, if possible
Updated by usa (Usaku NAKAMURA) over 9 years ago
- Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: REQUIRED to 2.0.0: WONTFIX, 2.1: REQUIRED, 2.2: REQUIRED
Updated by usa (Usaku NAKAMURA) over 9 years ago
- Backport changed from 2.0.0: WONTFIX, 2.1: REQUIRED, 2.2: REQUIRED to 2.0.0: WONTFIX, 2.1: DONE, 2.2: REQUIRED
ruby_2_1 r50576 merged revision(s) 50206.
Updated by nagachika (Tomoyuki Chikanaga) over 9 years ago
- Backport changed from 2.0.0: WONTFIX, 2.1: DONE, 2.2: REQUIRED to 2.0.0: WONTFIX, 2.1: DONE, 2.2: DONE
Backported into ruby_2_2
branch at r50624.