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.
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.
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.
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.
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?
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.