Project

General

Profile

Bug #10724

[TracePointAPI] Missing return event from initialize method when using `domain_name` gem

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

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 2.3.0dev (2015-01-09 trunk 49194) [i686-linux]
[ruby-core:67463]

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

test_tracepoint_with_domain_name.rb (896 Bytes) test_tracepoint_with_domain_name.rb deivid (David Rodríguez), 01/09/2015 10:43 AM
test_for_issue_10724.rb (726 Bytes) test_for_issue_10724.rb deivid (David Rodríguez), 01/20/2015 01:22 PM

Associated revisions

Revision 93df5a0a
Added by ko1 (Koichi Sasada) over 4 years ago

  • vm.c (vm_exec): check other events when RETURN is thrown. [Bug #10724]
  • test/ruby/test_settracefunc.rb: add a test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 50206
Added by ko1 (Koichi Sasada) over 4 years ago

  • vm.c (vm_exec): check other events when RETURN is thrown. [Bug #10724]
  • test/ruby/test_settracefunc.rb: add a test.

Revision 50206
Added by ko1 (Koichi Sasada) over 4 years ago

  • vm.c (vm_exec): check other events when RETURN is thrown. [Bug #10724]
  • test/ruby/test_settracefunc.rb: add a test.

Revision 50206
Added by ko1 (Koichi Sasada) over 4 years ago

  • vm.c (vm_exec): check other events when RETURN is thrown. [Bug #10724]
  • test/ruby/test_settracefunc.rb: add a test.

Revision 50206
Added by ko1 (Koichi Sasada) over 4 years ago

  • vm.c (vm_exec): check other events when RETURN is thrown. [Bug #10724]
  • test/ruby/test_settracefunc.rb: add a test.

Revision 50206
Added by ko1 (Koichi Sasada) over 4 years ago

  • vm.c (vm_exec): check other events when RETURN is thrown. [Bug #10724]
  • test/ruby/test_settracefunc.rb: add a test.

Revision 39a65664
Added by usa (Usaku NAKAMURA) over 4 years ago

merge revision(s) 50206: [Backport #10724]

    * vm.c (vm_exec): check other events when RETURN is thrown.
      [Bug #10724]

    * test/ruby/test_settracefunc.rb: add a test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@50576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 50576
Added by usa (Usaku NAKAMURA) over 4 years ago

merge revision(s) 50206: [Backport #10724]

* vm.c (vm_exec): check other events when RETURN is thrown.
  [Bug #10724]

* test/ruby/test_settracefunc.rb: add a test.

Revision e197429a
Added by nagachika (Tomoyuki Chikanaga) about 4 years ago

merge revision(s) 50206: [Backport #10724]

    * vm.c (vm_exec): check other events when RETURN is thrown.
      [Bug #10724]

    * test/ruby/test_settracefunc.rb: add a test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@50624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 50624
Added by nagachika (Tomoyuki Chikanaga) about 4 years ago

merge revision(s) 50206: [Backport #10724]

* vm.c (vm_exec): check other events when RETURN is thrown.
  [Bug #10724]

* test/ruby/test_settracefunc.rb: add a test.

History

Updated by deivid (David Rodríguez) over 4 years ago

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) over 4 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>
#4

Updated by deivid (David Rodríguez) over 4 years ago

ko1 (Koichi Sasada), any updates?

Thanks!

#5

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

#6

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

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

#8

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

#9

Updated by usa (Usaku NAKAMURA) over 4 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
#10

Updated by usa (Usaku NAKAMURA) over 4 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) about 4 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.

Also available in: Atom PDF