Wrong line numbers inside set_trace_func for end events #4060
Milestone
Comments
enebo
added a commit
that referenced
this issue
Dec 22, 2017
Fixes #4051. Wrong line numbers in Kernel#caller inside set_trace_func (with code to reproduce) #4051 was largely already fixed but the backtrace elements themselves had the wrong line (which was why #4060 was opened). The problem was mri changes their position of class/module/sclass from start line to end line. We just store start line. They will also look at first instr/node within the class/module for start line. That solution is memory efficient but then makes those nodes report wrong lines with -S ast. Our solution was to just add an endLine field to those nodes. The memory increase from that is very small so I think it is ok. The second part of this was that we build backtrace from setting line number via a line number instr. We had no end line so we couldn't emit one. Now that we have one we do....but only if --debug is supplied since the only instr after this point is return and that cannot raise (so we cannot generate a backtrace).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Somewhat as a continuation of #4051 there are still some wrong line numbers passed to
set_trace_func
and in backtraces generated inside of it.Environment
Running
jruby 9.1.3.0-SNAPSHOT (2.3.0) 2016-08-06 3ba469b OpenJDK 64-Bit Server VM 25.91-b14 on 1.8.0_91-8u91-b14-3ubuntu1~15.10.1-b14 [linux-x86_64]
(latest master, 3ba469b) onUbuntu 15.10
.Expected Behavior
Example code:
Output in MRI 2.3.1:
Actual Behavior
Output in JRuby:
You'll notice that neither the lines supplied to caller nor the ones to
set_trace_func
are correct in this case.The text was updated successfully, but these errors were encountered: