Project

General

Profile

Actions

Bug #14607

closed

Fix use of the rb_profile_frames start parameter

Bug #14607: Fix use of the rb_profile_frames start parameter

Added by dylants (Dylan Thacker-Smith) over 7 years ago. Updated almost 2 years ago.

Status:
Closed
Target version:
-
[ruby-core:86147]
Tags:

Description

rb_profile_frames was always behaving as if the value given for the start parameter was 0.

The reason for this was that it would check if (start > 0) { then continue without updating the control frame pointer or anything other than decrementing start.

This bug applies to all branches under normal maintenance, from ruby 2.3 to trunk.

Updated by tenderlovemaking (Aaron Patterson) over 7 years ago Actions #1

  • Status changed from Open to Closed

Applied in changeset trunk|r63265.


Fix use of rb_profile_frames start parameter

rb_profile_frames was always behaving as if the value given for the
start parameter was 0.

The reason for this was that it would check if (start > 0) { then
continue without updating the control frame pointer or anything other
than decrementing start.

[ruby-core:86147] [Bug #14607]

Co-authored-by: Dylan Thacker-Smith

Updated by tenderlovemaking (Aaron Patterson) over 7 years ago Actions #2 [ruby-core:86704]

  • Status changed from Closed to Open

ko1 said I shouldn't have committed the patch, so I reverted. Sorry!

Updated by ko1 (Koichi Sasada) over 7 years ago Actions #3 [ruby-core:86705]

I need to remember why such special (additional) calculation is done, so I left this ticket.
I need to remember...

Updated by dylants (Dylan Thacker-Smith) about 5 years ago Actions #4 [ruby-core:99479]

  • File deleted (fix-use-of-the-rb_profile_frames-start-parameter.patch)

The original patch has a merge conflict. However, I have opened a pull request with the fix for this issue (https://github.com/ruby/ruby/pull/2713) that has been rebased to resolve the merge conflict.

Updated by dylants (Dylan Thacker-Smith) over 4 years ago Actions #5 [ruby-core:103534]

I need to remember why such special (additional) calculation is done

I'm not sure what you mean by additional calculation. It is decrementing start when non-zero as expected to loop over that number of frames, it just was missing the corresponding update to cfp.

Could this get another look?

Updated by mame (Yusuke Endoh) over 3 years ago Actions #6 [ruby-core:108815]

  • Status changed from Open to Assigned
  • Assignee set to ko1 (Koichi Sasada)

I assume that "additional calculation" means the code if (start > 0) { start--; continue; }, but the "additional calculation" seems to make no sense at all to me either.

    for (i=0; i<limit && cfp != end_cfp;) {
        if (VM_FRAME_RUBYFRAME_P(cfp)) {
            if (start > 0) {
                start--;
                continue;
            }

It is essentially start = 0;. The proposed fix seems reasonable to me. @ko1 (Koichi Sasada) What do you think?

Updated by dylants (Dylan Thacker-Smith) almost 2 years ago Actions #7 [ruby-core:116233]

The original patch has a merge conflict. However, I have opened a pull request with the fix for this issue (https://github.com/ruby/ruby/pull/2713) that has been rebased to resolve the merge conflict.

The github PR has been merged, so this issue can be closed now. It doesn't look like I have permission to change its status though.

Updated by jeremyevans0 (Jeremy Evans) almost 2 years ago Actions #8

  • Status changed from Assigned to Closed
Actions

Also available in: PDF Atom