ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event
@ 2013-12-30  9:23 drkaes (Stefan Kaes)
  2013-12-30  9:28 ` [ruby-core:59399] [ruby-trunk - Bug #9321] " drkaes (Stefan Kaes)
                   ` (37 more replies)
  0 siblings, 38 replies; 41+ messages in thread
From: drkaes (Stefan Kaes) @ 2013-12-30  9:23 UTC (permalink / raw
  To: ruby-core


Issue #9321 has been reported by drkaes (Stefan Kaes).

----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321

Author: drkaes (Stefan Kaes)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.



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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59399] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
@ 2013-12-30  9:28 ` drkaes (Stefan Kaes)
  2013-12-30 11:05 ` [ruby-core:59403] " drkaes (Stefan Kaes)
                   ` (36 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: drkaes (Stefan Kaes) @ 2013-12-30  9:28 UTC (permalink / raw
  To: ruby-core


Issue #9321 has been updated by drkaes (Stefan Kaes).

File rb_mod_const_missing.patch added

I believe the attached patch fixes the problem.


----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-43962

Author: drkaes (Stefan Kaes)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.



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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59403] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
  2013-12-30  9:28 ` [ruby-core:59399] [ruby-trunk - Bug #9321] " drkaes (Stefan Kaes)
@ 2013-12-30 11:05 ` drkaes (Stefan Kaes)
  2013-12-30 11:06 ` [ruby-core:59404] " drkaes (Stefan Kaes)
                   ` (35 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: drkaes (Stefan Kaes) @ 2013-12-30 11:05 UTC (permalink / raw
  To: ruby-core


Issue #9321 has been updated by drkaes (Stefan Kaes).

File rb_mod_const_missing_with_tests.patch added

added tests to patch.
----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-43967

Author: drkaes (Stefan Kaes)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.



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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59404] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
  2013-12-30  9:28 ` [ruby-core:59399] [ruby-trunk - Bug #9321] " drkaes (Stefan Kaes)
  2013-12-30 11:05 ` [ruby-core:59403] " drkaes (Stefan Kaes)
@ 2013-12-30 11:06 ` drkaes (Stefan Kaes)
  2013-12-30 11:55 ` [ruby-core:59406] " tmm1 (Aman Gupta)
                   ` (34 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: drkaes (Stefan Kaes) @ 2013-12-30 11:06 UTC (permalink / raw
  To: ruby-core


Issue #9321 has been updated by drkaes (Stefan Kaes).


I believe this bug also exists in 1.9.3 and 2.0.0.

Any chance to backport?

----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-43968

Author: drkaes (Stefan Kaes)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.



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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59406] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (2 preceding siblings ...)
  2013-12-30 11:06 ` [ruby-core:59404] " drkaes (Stefan Kaes)
@ 2013-12-30 11:55 ` tmm1 (Aman Gupta)
  2013-12-30 12:21 ` [ruby-core:59407] " drkaes (Stefan Kaes)
                   ` (33 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: tmm1 (Aman Gupta) @ 2013-12-30 11:55 UTC (permalink / raw
  To: ruby-core


Issue #9321 has been updated by tmm1 (Aman Gupta).


Thanks for adding the test.

Seems like `rb_frame_pop()` should probably emit the event, but I'm not sure how to tell klass/mid in there.

BTW, doesn't this problem happen anytime an exception is raised? One or more stack frames can disappear without corresponding events.
----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-43969

Author: drkaes (Stefan Kaes)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.



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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59407] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (3 preceding siblings ...)
  2013-12-30 11:55 ` [ruby-core:59406] " tmm1 (Aman Gupta)
@ 2013-12-30 12:21 ` drkaes (Stefan Kaes)
  2013-12-31  9:55 ` [ruby-core:59433] " drkaes (Stefan Kaes)
                   ` (32 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: drkaes (Stefan Kaes) @ 2013-12-30 12:21 UTC (permalink / raw
  To: ruby-core


Issue #9321 has been updated by drkaes (Stefan Kaes).


rb_frame_pop is called in only one place, and that's the one which the patch addresses.

So yes, we could move the code to rb_frame_pop(), if we change it's signature.

I'm not sure, under which circumstances the problem can show it's ugly head.

This breaks (without patch):

def foo; UNKNOWN_CONSTANT rescue nil; end

These don't:

def foo; 1/0 rescue nil; end
def bar; raise "shoot" rescue nil; end






----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-43970

Author: drkaes (Stefan Kaes)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.



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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59433] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (4 preceding siblings ...)
  2013-12-30 12:21 ` [ruby-core:59407] " drkaes (Stefan Kaes)
@ 2013-12-31  9:55 ` drkaes (Stefan Kaes)
  2013-12-31 10:35 ` [ruby-core:59435] " drkaes (Stefan Kaes)
                   ` (31 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: drkaes (Stefan Kaes) @ 2013-12-31  9:55 UTC (permalink / raw
  To: ruby-core


Issue #9321 has been updated by drkaes (Stefan Kaes).


The patch has some issues with redefined Module#const_missing.

I'm in the process of preparing a new one.
----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-43991

Author: drkaes (Stefan Kaes)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.



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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59435] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (5 preceding siblings ...)
  2013-12-31  9:55 ` [ruby-core:59433] " drkaes (Stefan Kaes)
@ 2013-12-31 10:35 ` drkaes (Stefan Kaes)
  2013-12-31 10:39 ` [ruby-core:59436] " drkaes (Stefan Kaes)
                   ` (30 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: drkaes (Stefan Kaes) @ 2013-12-31 10:35 UTC (permalink / raw
  To: ruby-core


Issue #9321 has been updated by drkaes (Stefan Kaes).


Here's the new patch. I have moved the hook to rb_frame_pop().

The new patch makes sure that the method names sent along with call and return events are identical.

But I'm not sure whether the current ruby behavior in the presence of aliased methods is really the desired behavior.

Looking forward to feedback on this topic.
----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-43993

Author: drkaes (Stefan Kaes)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.



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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59436] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (6 preceding siblings ...)
  2013-12-31 10:35 ` [ruby-core:59435] " drkaes (Stefan Kaes)
@ 2013-12-31 10:39 ` drkaes (Stefan Kaes)
  2013-12-31 12:24 ` [ruby-core:59437] " ko1 (Koichi Sasada)
                   ` (29 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: drkaes (Stefan Kaes) @ 2013-12-31 10:39 UTC (permalink / raw
  To: ruby-core


Issue #9321 has been updated by drkaes (Stefan Kaes).

File rb_mod_const_missing_with_tests_redefined.patch added


----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-43994

Author: drkaes (Stefan Kaes)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.



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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59437] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (7 preceding siblings ...)
  2013-12-31 10:39 ` [ruby-core:59436] " drkaes (Stefan Kaes)
@ 2013-12-31 12:24 ` ko1 (Koichi Sasada)
  2013-12-31 23:31 ` [ruby-core:59442] " tmm1 (Aman Gupta)
                   ` (28 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: ko1 (Koichi Sasada) @ 2013-12-31 12:24 UTC (permalink / raw
  To: ruby-core


Issue #9321 has been updated by ko1 (Koichi Sasada).


The last patch is not acceptable because of performance reason.

I'll think about it.

----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-43996

Author: drkaes (Stefan Kaes)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.



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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59442] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (8 preceding siblings ...)
  2013-12-31 12:24 ` [ruby-core:59437] " ko1 (Koichi Sasada)
@ 2013-12-31 23:31 ` tmm1 (Aman Gupta)
  2014-01-02 11:30 ` [ruby-core:59467] " tmm1 (Aman Gupta)
                   ` (27 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: tmm1 (Aman Gupta) @ 2013-12-31 23:31 UTC (permalink / raw
  To: ruby-core


Issue #9321 has been updated by tmm1 (Aman Gupta).


I like the second patch, but now I'm not so sure about this technique.

Technically, const_missing never returns. So emitting a c_return event seems wrong. In fact, a raise event should be emitted from inside const_missing.

The "right" way to deal with this in ruby-prof would be to listen for the raise event and unwind the internal representation of the stack accordingly. Unfortunately, this is kind of tricky to implement.
----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-44000

Author: drkaes (Stefan Kaes)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.



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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59467] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (9 preceding siblings ...)
  2013-12-31 23:31 ` [ruby-core:59442] " tmm1 (Aman Gupta)
@ 2014-01-02 11:30 ` tmm1 (Aman Gupta)
  2014-01-02 18:19 ` [ruby-core:59470] " drkaes (Stefan Kaes)
                   ` (26 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: tmm1 (Aman Gupta) @ 2014-01-02 11:30 UTC (permalink / raw
  To: ruby-core


Issue #9321 has been updated by tmm1 (Aman Gupta).


In rblineprof, I maintain a stack of CALL events. When a RETURN event comes in, CALL entries on the internal stack are popped until one matching the RETURN is found.

  https://github.com/tmm1/rblineprof/blob/32795afc748f2f51cf76ce20ef6a85f50b9278c6/ext/rblineprof.c#L471-L475
----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-44019

Author: drkaes (Stefan Kaes)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.



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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59470] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (10 preceding siblings ...)
  2014-01-02 11:30 ` [ruby-core:59467] " tmm1 (Aman Gupta)
@ 2014-01-02 18:19 ` drkaes (Stefan Kaes)
  2014-01-07  9:01   ` [ruby-core:59623] " SASADA Koichi
  2014-01-03  5:38 ` [ruby-core:59501] " drkaes (Stefan Kaes)
                   ` (25 subsequent siblings)
  37 siblings, 1 reply; 41+ messages in thread
From: drkaes (Stefan Kaes) @ 2014-01-02 18:19 UTC (permalink / raw
  To: ruby-core


Issue #9321 has been updated by drkaes (Stefan Kaes).


@ko1: Why do you think the second patch creates a performance problem?

Module#const_missing is an exceptional case. Am I missing something?

@tmm1: the stack tracking approach breaks down if the method id reported on return by ruby does not match the one reported on call; which I have seen happening in the past.


----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-44021

Author: drkaes (Stefan Kaes)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.



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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59501] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (11 preceding siblings ...)
  2014-01-02 18:19 ` [ruby-core:59470] " drkaes (Stefan Kaes)
@ 2014-01-03  5:38 ` drkaes (Stefan Kaes)
  2014-01-03 17:10 ` [ruby-core:59535] " deivid (David Rodríguez)
                   ` (24 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: drkaes (Stefan Kaes) @ 2014-01-03  5:38 UTC (permalink / raw
  To: ruby-core


Issue #9321 has been updated by drkaes (Stefan Kaes).


@tmm1's suspicion was right: c-return is also missing in the case when you try to call a nonexistent method.

It seems that c-return will be missing when raising an exception from C land.

Which means my patch doesn't really solve the underlying, more fundamental problem.
----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-44046

Author: drkaes (Stefan Kaes)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.



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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59535] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (12 preceding siblings ...)
  2014-01-03  5:38 ` [ruby-core:59501] " drkaes (Stefan Kaes)
@ 2014-01-03 17:10 ` deivid (David Rodríguez)
  2014-01-05 18:56 ` [ruby-core:59560] " deivid (David Rodríguez)
                   ` (23 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: deivid (David Rodríguez) @ 2014-01-03 17:10 UTC (permalink / raw
  To: ruby-core


Issue #9321 has been updated by deivid (David Rodríguez).


But when raising an exception from ruby, return events are emitted... Shouldn't this 2 cases be consistent?
----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-44073

Author: drkaes (Stefan Kaes)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.



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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59560] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (13 preceding siblings ...)
  2014-01-03 17:10 ` [ruby-core:59535] " deivid (David Rodríguez)
@ 2014-01-05 18:56 ` deivid (David Rodríguez)
  2014-01-05 20:51 ` [ruby-core:59562] " tmm1 (Aman Gupta)
                   ` (22 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: deivid (David Rodríguez) @ 2014-01-05 18:56 UTC (permalink / raw
  To: ruby-core


Issue #9321 has been updated by deivid (David Rodríguez).


In byebug, the problem is I don't manually mantain the call stack, but only keep track of the stack size through the TracePoint API events. The only time I load the call stack is through the DebugInspector API right before the debugger stops in order to make it available to the user.

If I was to implement the solution suggested by @tmm1, how can I access the method_id for each frame from the C extension? Is the Thread::Backtrace::Locations API available to C extensions? Calling it through ruby for every c_return event will impact performance I guess...
----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-44097

Author: drkaes (Stefan Kaes)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.



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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59562] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (14 preceding siblings ...)
  2014-01-05 18:56 ` [ruby-core:59560] " deivid (David Rodríguez)
@ 2014-01-05 20:51 ` tmm1 (Aman Gupta)
  2014-01-06  7:25 ` [ruby-core:59579] " drkaes (Stefan Kaes)
                   ` (21 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: tmm1 (Aman Gupta) @ 2014-01-05 20:51 UTC (permalink / raw
  To: ruby-core


Issue #9321 has been updated by tmm1 (Aman Gupta).


You can use rb_profile_frames() in 2.1, but it only reports ruby frames so it won't help identify C-call/return events.

You could also use TracePoint#method_id either from ruby or C, but @skaes reports the method ids sometimes don't match up. Maybe we can figure out why and fix it.
----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-44098

Author: drkaes (Stefan Kaes)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.



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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59579] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (15 preceding siblings ...)
  2014-01-05 20:51 ` [ruby-core:59562] " tmm1 (Aman Gupta)
@ 2014-01-06  7:25 ` drkaes (Stefan Kaes)
  2014-01-06  7:38 ` [ruby-core:59580] " drkaes (Stefan Kaes)
                   ` (20 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: drkaes (Stefan Kaes) @ 2014-01-06  7:25 UTC (permalink / raw
  To: ruby-core


Issue #9321 has been updated by drkaes (Stefan Kaes).


I have extended the patch to also cover method_missing, by changing a single cfp pointer manipulation to a call of rb_frame_pop().

See https://github.com/skaes/rvm-patchsets/blob/master/patches/ruby/2.1.0/head/railsexpress/05-fix-missing-c-return-event.patch#L121

I have tested various other c functions raising exceptions. All of them work fine without the patches.

And my position is still that this is a ruby bug, which should be fixed instead of being worked around by all tool implementers.
----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-44113

Author: drkaes (Stefan Kaes)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.



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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59580] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (16 preceding siblings ...)
  2014-01-06  7:25 ` [ruby-core:59579] " drkaes (Stefan Kaes)
@ 2014-01-06  7:38 ` drkaes (Stefan Kaes)
  2014-01-07  8:04 ` [ruby-core:59620] " deivid (David Rodríguez)
                   ` (19 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: drkaes (Stefan Kaes) @ 2014-01-06  7:38 UTC (permalink / raw
  To: ruby-core


Issue #9321 has been updated by drkaes (Stefan Kaes).


The patch isn't ideal yet: in case of const-missing, the c-return event is generated too early. I know how to fix this. Will upload a modified patch later.

----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-44114

Author: drkaes (Stefan Kaes)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.



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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59620] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (17 preceding siblings ...)
  2014-01-06  7:38 ` [ruby-core:59580] " drkaes (Stefan Kaes)
@ 2014-01-07  8:04 ` deivid (David Rodríguez)
  2014-01-07 11:06 ` [ruby-core:59626] " drkaes (Stefan Kaes)
                   ` (18 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: deivid (David Rodríguez) @ 2014-01-07  8:04 UTC (permalink / raw
  To: ruby-core


Issue #9321 has been updated by deivid (David Rodríguez).


@drkaes If this only happens in certain c-methods it certainly looks like a bug. Thanks for working on this.

Thanks @tmm1, I guess I would have to store the method_id provided by the TracePoint API to be able to match it later.
----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-44149

Author: drkaes (Stefan Kaes)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.



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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59623] Re: [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2014-01-02 18:19 ` [ruby-core:59470] " drkaes (Stefan Kaes)
@ 2014-01-07  9:01   ` SASADA Koichi
  2014-01-07  9:37     ` [ruby-core:59625] " SASADA Koichi
  0 siblings, 1 reply; 41+ messages in thread
From: SASADA Koichi @ 2014-01-07  9:01 UTC (permalink / raw
  To: ruby-core

(2014/01/03 3:19), drkaes (Stefan Kaes) wrote:
> @ko1: Why do you think the second patch creates a performance problem?
> 
> Module#const_missing is an exceptional case. Am I missing something?

Sorry for my misunderstanding.

Let me clarify the spec.

###
n = 0
TracePoint.new(){|tp|
  next if tp.event == :line
  case tp.event.to_s
  when /call/
    puts "#{' ' * 2 * n}#{tp.inspect}"
    n+=1
  when /return/
    n-=1 if n>0
    puts "#{' ' * 2 * n}#{tp.inspect}"
  else
    puts "#{' ' * 2 * n}#{tp.inspect}"
  end
}.enable

def f
  Object::XYZZY #=> const_missing
end

f
__END__
#=>

current behavior:

#<TracePoint:c_return `enable'@test.rb:15>
#<TracePoint:c_call `method_added'@test.rb:17>
#<TracePoint:c_return `method_added'@test.rb:17>
#<TracePoint:call `f'@test.rb:17>
  #<TracePoint:c_call `const_missing'@test.rb:18>
    #<TracePoint:c_call `initialize'@test.rb:18>
      #<TracePoint:c_call `initialize'@test.rb:18>
      #<TracePoint:c_return `initialize'@test.rb:18>
    #<TracePoint:c_return `initialize'@test.rb:18>
    #<TracePoint:c_call `exception'@test.rb:18>
    #<TracePoint:c_return `exception'@test.rb:18>
    #<TracePoint:c_call `backtrace'@test.rb:18>
    #<TracePoint:c_return `backtrace'@test.rb:18>
    #<TracePoint:raise@test.rb:18>
  #<TracePoint:return `f'@test.rb:18>

expected behavior:

#<TracePoint:c_return `enable'@test.rb:15>
#<TracePoint:c_call `method_added'@test.rb:17>
#<TracePoint:c_return `method_added'@test.rb:17>
#<TracePoint:call `f'@test.rb:17>
  #<TracePoint:c_call `const_missing'@test.rb:18>
  #<TracePoint:c_return `const_missing'@test.rb:18> <-- NEW!
  #<TracePoint:c_call `initialize'@test.rb:18>
    #<TracePoint:c_call `initialize'@test.rb:18>
    #<TracePoint:c_return `initialize'@test.rb:18>
  #<TracePoint:c_return `initialize'@test.rb:18>
  #<TracePoint:c_call `exception'@test.rb:18>
  #<TracePoint:c_return `exception'@test.rb:18>
  #<TracePoint:c_call `backtrace'@test.rb:18>
  #<TracePoint:c_return `backtrace'@test.rb:18>
  #<TracePoint:raise@test.rb:18>
#<TracePoint:return `f'@test.rb:18>


is it right?

This behavior is similar to "raise" behavior.

-- 
// SASADA Koichi at atdot dot net

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59625] Re: [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2014-01-07  9:01   ` [ruby-core:59623] " SASADA Koichi
@ 2014-01-07  9:37     ` SASADA Koichi
  0 siblings, 0 replies; 41+ messages in thread
From: SASADA Koichi @ 2014-01-07  9:37 UTC (permalink / raw
  To: ruby-core

I modify the patch and all tests passes.
http://www.atdot.net/sp/raw/6ny0zm

If we can accept the spec of this behavior (order of tracing events), I
will commit it.

-- 
// SASADA Koichi at atdot dot net

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59626] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (18 preceding siblings ...)
  2014-01-07  8:04 ` [ruby-core:59620] " deivid (David Rodríguez)
@ 2014-01-07 11:06 ` drkaes (Stefan Kaes)
  2014-01-07 11:10 ` [ruby-core:59627] " deivid (David Rodríguez)
                   ` (17 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: drkaes (Stefan Kaes) @ 2014-01-07 11:06 UTC (permalink / raw
  To: ruby-core


Issue #9321 has been updated by drkaes (Stefan Kaes).


The order of trace events is acceptable.

It's not ideal though: I think one would expect the events for creating the exception and attaching the backtrace to it to happen inside const_missing/method_missing.

But it seems to me this would require more complex code changes.

Thx a lot for fixing this.

Is it possible to backport this to 2.0 and 1.9.3?

----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-44155

Author: drkaes (Stefan Kaes)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.



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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59627] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (19 preceding siblings ...)
  2014-01-07 11:06 ` [ruby-core:59626] " drkaes (Stefan Kaes)
@ 2014-01-07 11:10 ` deivid (David Rodríguez)
  2014-01-07 13:14 ` [ruby-core:59628] " drkaes (Stefan Kaes)
                   ` (16 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: deivid (David Rodríguez) @ 2014-01-07 11:10 UTC (permalink / raw
  To: ruby-core


Issue #9321 has been updated by deivid (David Rodríguez).


It sounds good to me. Any behavior with a balanced count of `call` and `return` events work.

Big thanks @ko1.
----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-44156

Author: drkaes (Stefan Kaes)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.



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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:59628] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (20 preceding siblings ...)
  2014-01-07 11:10 ` [ruby-core:59627] " deivid (David Rodríguez)
@ 2014-01-07 13:14 ` drkaes (Stefan Kaes)
  2014-03-30 16:32 ` [ruby-core:61769] " deivid.rodriguez
                   ` (15 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: drkaes (Stefan Kaes) @ 2014-01-07 13:14 UTC (permalink / raw
  To: ruby-core


Issue #9321 has been updated by drkaes (Stefan Kaes).


Compiling with clang produces warnings:

in file included from ./include/ruby/ruby.h:1694:
./include/ruby/intern.h:955:40: warning: unknown attribute 'warning' ignored [-Wattributes]
void rb_frame_pop(void) __attribute__((warning("rb_frame_pop is obsolete. It will be deleted after Ruby 2.2.0.")));;

You probably need to change the method signature to:

DEPRECATED(void rb_frame_pop(void));



----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-44157

Author: drkaes (Stefan Kaes)
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 
ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN


We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.



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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:61769] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (21 preceding siblings ...)
  2014-01-07 13:14 ` [ruby-core:59628] " drkaes (Stefan Kaes)
@ 2014-03-30 16:32 ` deivid.rodriguez
  2014-03-30 22:38 ` [ruby-core:61771] [ruby-trunk - Bug #9321] [Open] " ko1
                   ` (14 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: deivid.rodriguez @ 2014-03-30 16:32 UTC (permalink / raw
  To: ruby-core

Issue #9321 has been updated by David Rodríguez.


Hi @koichi, I'm still running into this issue... :( I really don't know what's going on, because the tests pass in ruby's test suite, but the `c_return` event is not generated when I use the TracePoint API.

    require 'minitest/autorun'

    class TestTracePoint < Minitest::Test
      def test_method_missing
        events = []
        assert !respond_to?(:missing_method_59398)
        TracePoint.new(:c_call, :c_return, :call, :return) { |tp|
          events << [tp.event, tp.method_id] if tp.method_id == :method_missing
        }.enable {
          missing_method_59398 rescue nil
        }
        assert_equal([[:c_call, :method_missing], [:c_return, :method_missing]], events)
      end
    end

    $ ruby --version
    ruby 2.1.1p76 (2014-02-24 revision 45161) [i686-linux]

    $ ruby test_tracepoint.rb 
    Run options: --seed 31045

    # Running:

    F

    Finished in 0.035420s, 28.2322 runs/s, 56.4645 assertions/s.

      1) Failure:
    TestTracePoint#test_method_missing [test_tracepoint.rb:12]:
    --- expected
    +++ actual
    @@ -1 +1 @@
    -[[:c_call, :method_missing], [:c_return, :method_missing]]
    +[[:c_call, :method_missing]]

   
    1 runs, 2 assertions, 1 failures, 0 errors, 0 skips

Also I have a couple of failing tests in byebug's test suite because of this. https://travis-ci.org/deivid-rodriguez/byebug/jobs/21874423

Thanks a lot.

----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-46007

* Author: Stefan Kaes
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: core
* Target version: 
* ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
* Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.


---Files--------------------------------
rb_mod_const_missing.patch (643 Bytes)
rb_mod_const_missing_with_tests.patch (1.48 KB)
rb_mod_const_missing_with_tests_redefined.patch (3.01 KB)


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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:61771] [ruby-trunk - Bug #9321] [Open] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (22 preceding siblings ...)
  2014-03-30 16:32 ` [ruby-core:61769] " deivid.rodriguez
@ 2014-03-30 22:38 ` ko1
  2014-03-31  9:31 ` [ruby-core:61778] [ruby-trunk - Bug #9321] " ko1
                   ` (13 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: ko1 @ 2014-03-30 22:38 UTC (permalink / raw
  To: ruby-core

Issue #9321 has been updated by Koichi Sasada.

Status changed from Closed to Open

----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-46009

* Author: Stefan Kaes
* Status: Open
* Priority: Normal
* Assignee: 
* Category: core
* Target version: 
* ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
* Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.


---Files--------------------------------
rb_mod_const_missing.patch (643 Bytes)
rb_mod_const_missing_with_tests.patch (1.48 KB)
rb_mod_const_missing_with_tests_redefined.patch (3.01 KB)


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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:61778] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (23 preceding siblings ...)
  2014-03-30 22:38 ` [ruby-core:61771] [ruby-trunk - Bug #9321] [Open] " ko1
@ 2014-03-31  9:31 ` ko1
  2014-03-31 14:10 ` [ruby-core:61780] " deivid.rodriguez
                   ` (12 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: ko1 @ 2014-03-31  9:31 UTC (permalink / raw
  To: ruby-core

Issue #9321 has been updated by Koichi Sasada.


I check with test/unit (modified as follow) and I got no error. Do I miss anything?

```ruby
require 'test/unit'

class TestTracePoint < Test::Unit::TestCase
  def test_method_missing
    events = []
    assert !respond_to?(:missing_method_59398)
    TracePoint.new(:c_call, :c_return, :call, :return) { |tp|
      events << [tp.event, tp.method_id] if tp.method_id == :method_missing
    }.enable {
      missing_method_59398 rescue nil
    }

    assert_equal([[:c_call, :method_missing], [:c_return, :method_missing]], events)
  end
end
```

And I got

```
1 tests, 2 assertions, 0 failures, 0 errors, 0 skips

ruby -v: ruby 2.2.0dev (2014-03-31 trunk 45486) [x86_64-linux]
```

Thanks,
Koichi

----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-46018

* Author: Stefan Kaes
* Status: Open
* Priority: Normal
* Assignee: 
* Category: core
* Target version: 
* ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
* Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.


---Files--------------------------------
rb_mod_const_missing.patch (643 Bytes)
rb_mod_const_missing_with_tests.patch (1.48 KB)
rb_mod_const_missing_with_tests_redefined.patch (3.01 KB)


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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:61780] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (24 preceding siblings ...)
  2014-03-31  9:31 ` [ruby-core:61778] [ruby-trunk - Bug #9321] " ko1
@ 2014-03-31 14:10 ` deivid.rodriguez
  2014-04-01  5:19 ` [ruby-core:61789] " ko1
                   ` (11 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: deivid.rodriguez @ 2014-03-31 14:10 UTC (permalink / raw
  To: ruby-core

Issue #9321 has been updated by David Rodríguez.


no no I AM missing something, sorry. I thought this bug fix was included in 2.1 but it's not. Last master works fine. I'm sorry for the confusion. And thanks a lot for having a look so quick!

----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-46020

* Author: Stefan Kaes
* Status: Open
* Priority: Normal
* Assignee: 
* Category: core
* Target version: 
* ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
* Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.


---Files--------------------------------
rb_mod_const_missing.patch (643 Bytes)
rb_mod_const_missing_with_tests.patch (1.48 KB)
rb_mod_const_missing_with_tests_redefined.patch (3.01 KB)


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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:61789] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (25 preceding siblings ...)
  2014-03-31 14:10 ` [ruby-core:61780] " deivid.rodriguez
@ 2014-04-01  5:19 ` ko1
  2014-04-01  6:07 ` [ruby-core:61790] [ruby-trunk - Bug #9321] [Closed] " naruse
                   ` (10 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: ko1 @ 2014-04-01  5:19 UTC (permalink / raw
  To: ruby-core

Issue #9321 has been updated by Koichi Sasada.


Ah, I see.

I think it should be backported, but it changes a behavior.

@naruse-san, can we backport it?


----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-46026

* Author: Stefan Kaes
* Status: Open
* Priority: Normal
* Assignee: 
* Category: core
* Target version: 
* ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
* Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.


---Files--------------------------------
rb_mod_const_missing.patch (643 Bytes)
rb_mod_const_missing_with_tests.patch (1.48 KB)
rb_mod_const_missing_with_tests_redefined.patch (3.01 KB)


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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:61790] [ruby-trunk - Bug #9321] [Closed] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (26 preceding siblings ...)
  2014-04-01  5:19 ` [ruby-core:61789] " ko1
@ 2014-04-01  6:07 ` naruse
  2014-04-01  6:13 ` [ruby-core:61791] [ruby-trunk - Bug #9321] " ko1
                   ` (9 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: naruse @ 2014-04-01  6:07 UTC (permalink / raw
  To: ruby-core

Issue #9321 has been updated by Yui NARUSE.

Status changed from Open to Closed
Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN to 2.0.0: REQUIRED, 2.1: REQUIRED

ささださん曰く、
> const_missing が呼ばれると、c_call は飛ばれるのに c_return が呼ばれない、ので、デバッガ作るときに困るので、
> c_return 呼ばれるようにした。
> これに依存した挙動は無いんじゃ無いかと思うのだが
とのこと。
具体的に結果がどう変わるかは
https://bugs.ruby-lang.org/issues/9321#note-20


----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-46027

* Author: Stefan Kaes
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: core
* Target version: 
* ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
* Backport: 2.0.0: REQUIRED, 2.1: REQUIRED
----------------------------------------
We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.


---Files--------------------------------
rb_mod_const_missing.patch (643 Bytes)
rb_mod_const_missing_with_tests.patch (1.48 KB)
rb_mod_const_missing_with_tests_redefined.patch (3.01 KB)


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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:61791] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (27 preceding siblings ...)
  2014-04-01  6:07 ` [ruby-core:61790] [ruby-trunk - Bug #9321] [Closed] " naruse
@ 2014-04-01  6:13 ` ko1
  2014-04-01 11:45 ` [ruby-core:61798] " deivid.rodriguez
                   ` (8 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: ko1 @ 2014-04-01  6:13 UTC (permalink / raw
  To: ruby-core

Issue #9321 has been updated by Koichi Sasada.


This issues is available on 2.1 and 2.0.

This is possible that some applications implement workaround for this issue. This patch can breaks such applications. However, I'm not sure such applications exist (maybe don't exist).


----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-46029

* Author: Stefan Kaes
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: core
* Target version: 
* ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
* Backport: 2.0.0: REQUIRED, 2.1: REQUIRED
----------------------------------------
We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.


---Files--------------------------------
rb_mod_const_missing.patch (643 Bytes)
rb_mod_const_missing_with_tests.patch (1.48 KB)
rb_mod_const_missing_with_tests_redefined.patch (3.01 KB)


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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:61798] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (28 preceding siblings ...)
  2014-04-01  6:13 ` [ruby-core:61791] [ruby-trunk - Bug #9321] " ko1
@ 2014-04-01 11:45 ` deivid.rodriguez
  2014-04-14 22:10 ` [ruby-core:62030] " ko1
                   ` (7 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: deivid.rodriguez @ 2014-04-01 11:45 UTC (permalink / raw
  To: ruby-core

Issue #9321 has been updated by David Rodríguez.


As far as I'm concerned, this changes an (incorrect) behaviour and it should be backported. In byebug's case, having a balanced count of call and return events is critical and directly affects usability of the debugger. And when I thought of implementing a workaround inside byebug's didn't seem like an easy thing to do...

Stefan Kaes, did you implement a workaround for this in ruby-prof?

Cheers!

----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-46033

* Author: Stefan Kaes
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: core
* Target version: 
* ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
* Backport: 2.0.0: REQUIRED, 2.1: REQUIRED
----------------------------------------
We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.


---Files--------------------------------
rb_mod_const_missing.patch (643 Bytes)
rb_mod_const_missing_with_tests.patch (1.48 KB)
rb_mod_const_missing_with_tests_redefined.patch (3.01 KB)


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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:62030] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (29 preceding siblings ...)
  2014-04-01 11:45 ` [ruby-core:61798] " deivid.rodriguez
@ 2014-04-14 22:10 ` ko1
  2014-04-17  7:54 ` [ruby-core:62071] " deivid.rodriguez
                   ` (6 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: ko1 @ 2014-04-14 22:10 UTC (permalink / raw
  To: ruby-core

Issue #9321 has been updated by Koichi Sasada.


I vote to backport this ticket. I want to help them:
https://github.com/deivid-rodriguez/byebug/issues/16#issuecomment-40421841



----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-46214

* Author: Stefan Kaes
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: core
* Target version: 
* ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
* Backport: 2.0.0: REQUIRED, 2.1: REQUIRED
----------------------------------------
We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.


---Files--------------------------------
rb_mod_const_missing.patch (643 Bytes)
rb_mod_const_missing_with_tests.patch (1.48 KB)
rb_mod_const_missing_with_tests_redefined.patch (3.01 KB)


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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:62071] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (30 preceding siblings ...)
  2014-04-14 22:10 ` [ruby-core:62030] " ko1
@ 2014-04-17  7:54 ` deivid.rodriguez
  2014-06-09 13:05 ` [ruby-core:63020] " deivid.rodriguez
                   ` (5 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: deivid.rodriguez @ 2014-04-17  7:54 UTC (permalink / raw
  To: ruby-core

Issue #9321 has been updated by David Rodríguez.


Thanks Koichi, appreciated. :)

----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-46243

* Author: Stefan Kaes
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: core
* Target version: 
* ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
* Backport: 2.0.0: REQUIRED, 2.1: REQUIRED
----------------------------------------
We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.


---Files--------------------------------
rb_mod_const_missing.patch (643 Bytes)
rb_mod_const_missing_with_tests.patch (1.48 KB)
rb_mod_const_missing_with_tests_redefined.patch (3.01 KB)


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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:63020] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (31 preceding siblings ...)
  2014-04-17  7:54 ` [ruby-core:62071] " deivid.rodriguez
@ 2014-06-09 13:05 ` deivid.rodriguez
  2014-06-19  6:08 ` [ruby-core:63237] " nagachika00
                   ` (4 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: deivid.rodriguez @ 2014-06-09 13:05 UTC (permalink / raw
  To: ruby-core

Issue #9321 has been updated by David Rodríguez.


Is there an official way to request a backport? Thanks!

----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-47106

* Author: Stefan Kaes
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: core
* Target version: 
* ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
* Backport: 2.0.0: REQUIRED, 2.1: REQUIRED
----------------------------------------
We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.


---Files--------------------------------
rb_mod_const_missing.patch (643 Bytes)
rb_mod_const_missing_with_tests.patch (1.48 KB)
rb_mod_const_missing_with_tests_redefined.patch (3.01 KB)


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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:63237] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (32 preceding siblings ...)
  2014-06-09 13:05 ` [ruby-core:63020] " deivid.rodriguez
@ 2014-06-19  6:08 ` nagachika00
  2014-06-23 22:43 ` [ruby-core:63308] " deivid.rodriguez
                   ` (3 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: nagachika00 @ 2014-06-19  6:08 UTC (permalink / raw
  To: ruby-core

Issue #9321 has been updated by Tomoyuki Chikanaga.


I agree that this should be backported to 2.1 branch.
Is there any opposite opinion?

----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-47281

* Author: Stefan Kaes
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: core
* Target version: 
* ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
* Backport: 2.0.0: REQUIRED, 2.1: REQUIRED
----------------------------------------
We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.


---Files--------------------------------
rb_mod_const_missing.patch (643 Bytes)
rb_mod_const_missing_with_tests.patch (1.48 KB)
rb_mod_const_missing_with_tests_redefined.patch (3.01 KB)


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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:63308] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (33 preceding siblings ...)
  2014-06-19  6:08 ` [ruby-core:63237] " nagachika00
@ 2014-06-23 22:43 ` deivid.rodriguez
  2014-06-29 16:13 ` [ruby-core:63400] " nagachika00
                   ` (2 subsequent siblings)
  37 siblings, 0 replies; 41+ messages in thread
From: deivid.rodriguez @ 2014-06-23 22:43 UTC (permalink / raw
  To: ruby-core

Issue #9321 has been updated by David Rodríguez.


Thanks for following up Tomoyuki!

----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-47358

* Author: Stefan Kaes
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: core
* Target version: 
* ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
* Backport: 2.0.0: REQUIRED, 2.1: REQUIRED
----------------------------------------
We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.


---Files--------------------------------
rb_mod_const_missing.patch (643 Bytes)
rb_mod_const_missing_with_tests.patch (1.48 KB)
rb_mod_const_missing_with_tests_redefined.patch (3.01 KB)


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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:63400] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (34 preceding siblings ...)
  2014-06-23 22:43 ` [ruby-core:63308] " deivid.rodriguez
@ 2014-06-29 16:13 ` nagachika00
  2014-07-03  6:21 ` [ruby-core:63536] " usa
  2014-07-03  6:25 ` [ruby-core:63537] " usa
  37 siblings, 0 replies; 41+ messages in thread
From: nagachika00 @ 2014-06-29 16:13 UTC (permalink / raw
  To: ruby-core

Issue #9321 has been updated by Tomoyuki Chikanaga.

Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED to 2.0.0: REQUIRED, 2.1: DONE

Backported into `ruby_2_1` branch at r46608.

----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-47442

* Author: Stefan Kaes
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: core
* Target version: 
* ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
* Backport: 2.0.0: REQUIRED, 2.1: DONE
----------------------------------------
We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.


---Files--------------------------------
rb_mod_const_missing.patch (643 Bytes)
rb_mod_const_missing_with_tests.patch (1.48 KB)
rb_mod_const_missing_with_tests_redefined.patch (3.01 KB)


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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:63536] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (35 preceding siblings ...)
  2014-06-29 16:13 ` [ruby-core:63400] " nagachika00
@ 2014-07-03  6:21 ` usa
  2014-07-03  6:25 ` [ruby-core:63537] " usa
  37 siblings, 0 replies; 41+ messages in thread
From: usa @ 2014-07-03  6:21 UTC (permalink / raw
  To: ruby-core

Issue #9321 has been updated by Usaku NAKAMURA.


backported into `ruby_2_0_0` at r46671.

----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-47585

* Author: Stefan Kaes
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: core
* Target version: 
* ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
* Backport: 2.0.0: REQUIRED, 2.1: DONE
----------------------------------------
We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.


---Files--------------------------------
rb_mod_const_missing.patch (643 Bytes)
rb_mod_const_missing_with_tests.patch (1.48 KB)
rb_mod_const_missing_with_tests_redefined.patch (3.01 KB)


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

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [ruby-core:63537] [ruby-trunk - Bug #9321] rb_mod_const_missing does not generate a c-return event
  2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
                   ` (36 preceding siblings ...)
  2014-07-03  6:21 ` [ruby-core:63536] " usa
@ 2014-07-03  6:25 ` usa
  37 siblings, 0 replies; 41+ messages in thread
From: usa @ 2014-07-03  6:25 UTC (permalink / raw
  To: ruby-core

Issue #9321 has been updated by Usaku NAKAMURA.

Backport changed from 2.0.0: REQUIRED, 2.1: DONE to 2.0.0: DONE, 2.1: DONE

----------------------------------------
Bug #9321: rb_mod_const_missing does not generate a c-return event
https://bugs.ruby-lang.org/issues/9321#change-47586

* Author: Stefan Kaes
* Status: Closed
* Priority: Normal
* Assignee: 
* Category: core
* Target version: 
* ruby -v: ruby 2.1.0p1 (2013-12-26 revision 44431) [x86_64-darwin12.0]
* Backport: 2.0.0: DONE, 2.1: DONE
----------------------------------------
We have had an issue reported for ruby-prof where execution times were attributed incorrectly in the call graph.

It turned out that the problem is caused by a missing c-return event for Module#const_missing.

ruby-prof simulates the ruby call stack by subscribing to line, call, c-call, return and c-return events.

Obviously, the missing return throws ruby-prof off the track.


---Files--------------------------------
rb_mod_const_missing.patch (643 Bytes)
rb_mod_const_missing_with_tests.patch (1.48 KB)
rb_mod_const_missing_with_tests_redefined.patch (3.01 KB)


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

^ permalink raw reply	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2014-07-03  6:03 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-30  9:23 [ruby-core:59398] [ruby-trunk - Bug #9321][Open] rb_mod_const_missing does not generate a c-return event drkaes (Stefan Kaes)
2013-12-30  9:28 ` [ruby-core:59399] [ruby-trunk - Bug #9321] " drkaes (Stefan Kaes)
2013-12-30 11:05 ` [ruby-core:59403] " drkaes (Stefan Kaes)
2013-12-30 11:06 ` [ruby-core:59404] " drkaes (Stefan Kaes)
2013-12-30 11:55 ` [ruby-core:59406] " tmm1 (Aman Gupta)
2013-12-30 12:21 ` [ruby-core:59407] " drkaes (Stefan Kaes)
2013-12-31  9:55 ` [ruby-core:59433] " drkaes (Stefan Kaes)
2013-12-31 10:35 ` [ruby-core:59435] " drkaes (Stefan Kaes)
2013-12-31 10:39 ` [ruby-core:59436] " drkaes (Stefan Kaes)
2013-12-31 12:24 ` [ruby-core:59437] " ko1 (Koichi Sasada)
2013-12-31 23:31 ` [ruby-core:59442] " tmm1 (Aman Gupta)
2014-01-02 11:30 ` [ruby-core:59467] " tmm1 (Aman Gupta)
2014-01-02 18:19 ` [ruby-core:59470] " drkaes (Stefan Kaes)
2014-01-07  9:01   ` [ruby-core:59623] " SASADA Koichi
2014-01-07  9:37     ` [ruby-core:59625] " SASADA Koichi
2014-01-03  5:38 ` [ruby-core:59501] " drkaes (Stefan Kaes)
2014-01-03 17:10 ` [ruby-core:59535] " deivid (David Rodríguez)
2014-01-05 18:56 ` [ruby-core:59560] " deivid (David Rodríguez)
2014-01-05 20:51 ` [ruby-core:59562] " tmm1 (Aman Gupta)
2014-01-06  7:25 ` [ruby-core:59579] " drkaes (Stefan Kaes)
2014-01-06  7:38 ` [ruby-core:59580] " drkaes (Stefan Kaes)
2014-01-07  8:04 ` [ruby-core:59620] " deivid (David Rodríguez)
2014-01-07 11:06 ` [ruby-core:59626] " drkaes (Stefan Kaes)
2014-01-07 11:10 ` [ruby-core:59627] " deivid (David Rodríguez)
2014-01-07 13:14 ` [ruby-core:59628] " drkaes (Stefan Kaes)
2014-03-30 16:32 ` [ruby-core:61769] " deivid.rodriguez
2014-03-30 22:38 ` [ruby-core:61771] [ruby-trunk - Bug #9321] [Open] " ko1
2014-03-31  9:31 ` [ruby-core:61778] [ruby-trunk - Bug #9321] " ko1
2014-03-31 14:10 ` [ruby-core:61780] " deivid.rodriguez
2014-04-01  5:19 ` [ruby-core:61789] " ko1
2014-04-01  6:07 ` [ruby-core:61790] [ruby-trunk - Bug #9321] [Closed] " naruse
2014-04-01  6:13 ` [ruby-core:61791] [ruby-trunk - Bug #9321] " ko1
2014-04-01 11:45 ` [ruby-core:61798] " deivid.rodriguez
2014-04-14 22:10 ` [ruby-core:62030] " ko1
2014-04-17  7:54 ` [ruby-core:62071] " deivid.rodriguez
2014-06-09 13:05 ` [ruby-core:63020] " deivid.rodriguez
2014-06-19  6:08 ` [ruby-core:63237] " nagachika00
2014-06-23 22:43 ` [ruby-core:63308] " deivid.rodriguez
2014-06-29 16:13 ` [ruby-core:63400] " nagachika00
2014-07-03  6:21 ` [ruby-core:63536] " usa
2014-07-03  6:25 ` [ruby-core:63537] " usa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).