Exception starting new thread after set_trace_func call #1355

denofevil opened this Issue Dec 21, 2013 · 5 comments


None yet

4 participants


Consider following code sample

set_trace_func proc { |event, file, line, obj, binding, clazz| }
Thread.new do
  puts "hello"

In 1.9 mode it works ok and exits after printing hello. In 2.0 mode, it throws following exception:

Exception in thread "RubyThread-2: /Users/denofevil/RubymineProjects/debug_test/jruby_debug.rb:2" java.lang.ArrayIndexOutOfBoundsException: -1
    at org.jruby.runtime.ThreadContext.getCurrentFrame(ThreadContext.java:447)
    at org.jruby.runtime.ThreadContext.getFrameKlazz(ThreadContext.java:586)
    at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:96)
    at java.lang.Thread.run(Thread.java:695)

This issue greatly affects debugging JRuby in 2.0 mode and it was originally reported in RubyMine tracker against 1.7.8, but it seems that the problem was introduced earlier as mentioned in ruby-debug/ruby-debug-ide#37


like I stated in that issue , it worked before with prior versions of RubyMine and prior versions of Jruby which is why I had suspected to be either a new gem being pulled in which RubyMine does, or something different in RubyMine. I probably had not worked on this 2.0 based project for about a month or so , so something introduced recently.

headius commented Dec 27, 2013

Officially, 2.0 mode is only experimental in JRuby 1.7.x, so we wouldn't normally prioritize 2.0 mode fixes along that branch. Unofficially, this is fixed on master and I'll see if I can backport it.


Thank you!

headius commented Dec 29, 2013

This is the same as #1318.

headius commented Dec 29, 2013

The fix for #1318 has been merged into jruby-1_7.

@headius headius closed this Dec 29, 2013
@enebo enebo modified the milestone: JRuby 1.7.10, JRuby 1.7.11 Feb 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment