Java stacktrace includes extra useful information such as locked/waiting
mutex objects (e.g. - waiting on org.jruby.RubyThread@544fe44c). This
change shows Java stacktrace in addition to Ruby stacktrace.
dump_object_count is disabled because it causes undefined method
exception.
Example:
Thread #<Thread:0x6e1567f1> status=run priority=0
/Users/frsyuki/project/sigdump/lib/sigdump.rb:52:in `backtrace'
/Users/frsyuki/project/sigdump/lib/sigdump.rb:52:in `dump_backtrace'
/Users/frsyuki/project/sigdump/lib/sigdump.rb:34:in `dump_all_thread_backtrace'
/Users/frsyuki/project/sigdump/lib/sigdump.rb:33:in `each'
/Users/frsyuki/project/sigdump/lib/sigdump.rb:33:in `dump_all_thread_backtrace'
/Users/frsyuki/project/sigdump/lib/sigdump.rb:16:in `dump'
/Users/frsyuki/project/sigdump/lib/sigdump.rb:144:in `open'
/Users/frsyuki/project/sigdump/lib/sigdump.rb:144:in `_open_dump_path'
/Users/frsyuki/project/sigdump/lib/sigdump.rb:14:in `dump'
-e:1:in `(root)'
In Java "main" Id=1 RUNNABLE
at sun.management.ThreadImpl.dumpThreads0(Native Method)
at sun.management.ThreadImpl.getThreadInfo(ThreadImpl.java:448)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:486)
at org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:341)
...
Thread #<Thread:0x2038ae61> status=sleep priority=0
-e:1:in `sleep'
-e:1:in `(root)'
In Java "Ruby-0-Thread-7: -e:1" Id=18 TIMED_WAITING on org.jruby.RubyThread@2038ae61
at java.lang.Object.wait(Native Method)
- waiting on org.jruby.RubyThread@2038ae61
at org.jruby.RubyThread.sleep(RubyThread.java:1001)
at org.jruby.RubyKernel.sleep(RubyKernel.java:803)
at org.jruby.RubyKernel$INVOKER$s$0$1$sleep.call(RubyKernel$INVOKER$s$0$1$sleep.gen)
at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:669)
at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:206)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)
at ruby.__dash_e__.block_1$RUBY$__file__(-e:1)
...
Java stacktrace includes extra useful information such as locked/waiting mutex objects (e.g.
- waiting on org.jruby.RubyThread@544fe44c
). This change shows Java stacktrace in addition to Ruby stacktrace.dump_object_count
is disabled because it causesundefined method
exception.Example: