Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
JRuby throws java.lang.ArrayIndexOutOfBoundsException #3781
Exception in thread "Ruby-0-Thread-38: /Users/dennis/.rvm/gems/jruby-1.7.24/gems/puma-3.2.0-java/lib/puma/thread_pool.rb:67" java.lang.ArrayIndexOutOfBoundsException: -1
Tried it on webrick same results:
Exception in thread "Ruby-0-Thread-12: /Users/dennis/.rvm/rubies/jruby-1.7.24/lib/ruby/1.9/webrick/server.rb:180" java.lang.ArrayIndexOutOfBoundsException: -1
Provide at least:
Other relevant info you may wish to add:
gem "sequel", "188.8.131.5269d34f70988ff5e2d4489b876d1cc303accdc9"
We run a simple validation were sequel need to check for a require field , email in this case and gives and error messages attached to an associated object.
Instead of returning an error message or any backtrace in the rails log , I getting this exception above
@dennis-d Can you try running this again with JRUBY_OPTS='--1.9 -Xbacktrace.style=raw -d' and see what we can in a deeper stack trace. Although that might not figure this out.
So there are two problems:
So we definitely have an issue here. I also think something is doing something in your app that you are not expecting though. Tough to know until we figure out more though.
$ jruby -Xbacktrace.style=raw -d -S rake cucumber:platform FEATURE=features/manage_reports.feature:129 --trace
1 scenario (1 failed)
Command output with rails 3.2
@dennis-d So just changing to rails 184.108.40.206 and all is well again? In original report I see 4.1.15 and you last comment shows some stacktrace with 3.2 but with no AAIOBE in it. Are these other exceptions normal for you?
A few things:
This post is mostly about me not seeing any new info and hoping we can localize this issue bit. App bugs can be tough to reduce...
OK, I found a chunk of code that cause the problem, and I change it on out side. And error goes away
But here is an example:
We have a mode with multiple validations
Pretty sure I know what this is.
There appears to be a TracePoint or set_trace_func installed that's trying to report an exception raised when a thread bubbles out some flow control exception.
...so the frame stack is empty...
...while trying to construct a LocalJumpError...
...while finishing up a Thread.
And a reproduction in JRuby:
Because this is not specifically a 9k bug, I'm moving it to 1.7.26, so we can get rid of that exception raise at thread root.
The larger issue I'll file separately. It affects both 1.7 and 9k, but only 9k will have thread-root-level trace events after this issue gets fixed.
referenced this issue
Apr 28, 2016
added a commit
Mar 15, 2017
I've done a somewhat ugly fix in 9dcc41c that just re-pushes the need information into the thread context around the exception creation. It allows this to work correctly as in JRuby 9k, and since the hook has the frame's top-level it should get a usable binding too.
This is about as far as I want to push it. Given that set_trace_func hooks always acquire a binding, I'm not sure we can do less than this (like my initial idea of just creating the exception in a lightweight way and manually triggering the hook, which would still produce a bad binding.
The approach I used might also work for the thread begin/end hooks in 9k.