-
-
Notifications
You must be signed in to change notification settings - Fork 925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
strange stacktrace #3177
Comments
its the JVM trying to get you some information about why you're "deep into recursion" ... the script as-is simply won't work without the JVM failing with a java_import 'Test'
test = Test.new {
2.times { puts "running #{self}" }
}
test.run |
I debugged with jdb and I found the cause of the bug. I rewrote the test programs to clarify the cause. public class Test {
private Runnable r;
public Test(Runnable run)
{
r = run;
}
public void java_run(int i) throws Exception
{
if (i == 2)
{
throw new Exception();
}
else
{
r.run();
}
}
} java_import 'Test'
i = 0
test = Test.new {
1.times {
begin
test.java_run(i += 1)
rescue java.lang.Exception
puts $!.backtrace
puts
raise
end
}
}
begin
test.java_run(0)
rescue java.lang.Exception
puts $!.backtrace
end The following is the output.
|
OK, now I get it - the new code helped me to grasp, thanks! confirmed on 1.7.21 as well, fix on its way ... |
…3177) ... some parts e.g. Java based core-methods had their filename part incorrect when re-thrown (adding package prefix path twice)
fix works but there's another issue appearing when exception is re-thrown - duplicating .rb parts e.g. :
|
* jruby-1_7: FrameType's INTERPRETER_ constants are a leaky abstraction - deprecate for now we do not care about duplicate .rb frames in re-thrown Java exception occupy less space with FrameType's static collections deprecate no longer used Helpers.invokeMethodMissing method toArray one-liner add a test reproducing backtrace issue #3177 improve backtrace rewriting when native exception is re-thrown (fixes #3177) more test_backtraces TODO left-overs ... these are passing just fine as well removed TODOs in test_backtraces - they seem to be all passing cleanup test_backtraces save an interim builder+string with mangleStringForCleanJavaIdentifier + guess string builder length for possibly less internal array resizing avoid 'too much' of try-catch IOException - throw runtime error directly minor name mangler cleanup + "micro opts" - slightly less code to execute cleanup JRubyFile Conflicts: core/src/main/java/org/jruby/runtime/backtrace/BacktraceData.java core/src/main/java/org/jruby/runtime/backtrace/FrameType.java core/src/main/java/org/jruby/util/JRubyFile.java test/test_backtraces.rb
"org/jruby/" appears many times in the stacktrace of the following script.
Test.java
test.rb
output
The text was updated successfully, but these errors were encountered: