Skip to content

Exception starting new thread after set_trace_func call #1355

@denofevil

Description

@denofevil

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions