Skip to content
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

Exception starting new thread after set_trace_func call #1355

Closed
denofevil opened this issue Dec 21, 2013 · 5 comments
Closed

Exception starting new thread after set_trace_func call #1355

denofevil opened this issue Dec 21, 2013 · 5 comments
Milestone

Comments

@denofevil
Copy link

@denofevil denofevil commented Dec 21, 2013

Consider following code sample

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

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

@amiracam
Copy link

@amiracam amiracam commented Dec 22, 2013

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
Copy link
Member

@headius 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.

@denofevil
Copy link
Author

@denofevil denofevil commented Dec 28, 2013

Thank you!

@headius
Copy link
Member

@headius headius commented Dec 29, 2013

This is the same as #1318.

@headius
Copy link
Member

@headius 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 added this to the JRuby 1.7.10 milestone Feb 24, 2014
@enebo enebo removed this from the JRuby 1.7.11 milestone Feb 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants