Skip to content

Instantly share code, notes, and snippets.

@chuckremes
Last active January 31, 2017 11:33
Show Gist options
  • Save chuckremes/5099307 to your computer and use it in GitHub Desktop.
Save chuckremes/5099307 to your computer and use it in GitHub Desktop.
thread.backtrace is sometimes nil in jruby.
Exception in thread "JRubyWorker-57" java.lang.NullPointerException
at org.jruby.RubyThread.backtrace(RubyThread.java:973)
at rubyjit.Celluloid::StackDump$$snapshot_thread_47B21CF45C0FFCE0D8550EEBD839410A0BF60A1B424058530.__file__(/Users/cremes/.rvm/gems/jruby-1.7.2/gems/celluloid-0.13.0.pre/lib/celluloid/stack_dump.rb:53)
at rubyjit.Celluloid::StackDump$$snapshot_thread_47B21CF45C0FFCE0D8550EEBD839410A0BF60A1B424058530.__file__(/Users/cremes/.rvm/gems/jruby-1.7.2/gems/celluloid-0.13.0.pre/lib/celluloid/stack_dump.rb)
at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:181)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)
at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
at org.jruby.ast.IfNode.interpret(IfNode.java:118)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
at org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:209)
at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:160)
at org.jruby.runtime.Block.yield(Block.java:130)
at org.jruby.RubyArray.eachCommon(RubyArray.java:1606)
at org.jruby.RubyArray.each(RubyArray.java:1613)
at org.jruby.RubyArray$INVOKER$i$0$0$each.call(RubyArray$INVOKER$i$0$0$each.gen)
at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:143)
at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:154)
at org.jruby.ast.CallNoArgBlockNode.interpret(CallNoArgBlockNode.java:64)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:172)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:134)
at org.jruby.ast.VCallNode.interpret(VCallNode.java:88)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:161)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:180)
at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:143)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:149)
at org.jruby.RubyClass.newInstance(RubyClass.java:848)
at org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)
at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroOrNBlock.call(JavaMethod.java:261)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:134)
at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:64)
at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:172)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:134)
at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:64)
at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:172)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:134)
at org.jruby.ast.VCallNode.interpret(VCallNode.java:88)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
at org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:209)
at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:160)
at org.jruby.runtime.Interpreted19Block.yieldSpecific(Interpreted19Block.java:133)
at org.jruby.runtime.Block.yieldSpecific(Block.java:99)
at org.jruby.runtime.invokedynamic.InvocationLinker.yieldSpecificFallback(InvocationLinker.java:399)
at rubyjit.Celluloid::TaskFiber$$initialize_6A8830911B6F369CFF4DCAFBBA5A5D41AA8F014C424058530.chained_1_rescue_1$RUBY$SYNTHETIC__file__(/Users/cremes/.rvm/gems/jruby-1.7.2/gems/celluloid-0.13.0.pre/lib/celluloid/tasks/task_fiber.rb:28)
at rubyjit.Celluloid::TaskFiber$$initialize_6A8830911B6F369CFF4DCAFBBA5A5D41AA8F014C424058530.chained_0_ensure_1$RUBY$__ensure__(/Users/cremes/.rvm/gems/jruby-1.7.2/gems/celluloid-0.13.0.pre/lib/celluloid/tasks/task_fiber.rb)
at rubyjit.Celluloid::TaskFiber$$initialize_6A8830911B6F369CFF4DCAFBBA5A5D41AA8F014C424058530.block_0$RUBY$__file__(/Users/cremes/.rvm/gems/jruby-1.7.2/gems/celluloid-0.13.0.pre/lib/celluloid/tasks/task_fiber.rb:27)
at rubyjit$Celluloid::TaskFiber$$initialize_6A8830911B6F369CFF4DCAFBBA5A5D41AA8F014C424058530$block_0$RUBY$__file__.call(rubyjit$Celluloid::TaskFiber$$initialize_6A8830911B6F369CFF4DCAFBBA5A5D41AA8F014C424058530$block_0$RUBY$__file__)
at org.jruby.runtime.CompiledBlock19.yield(CompiledBlock19.java:163)
at org.jruby.runtime.CompiledBlock19.yield(CompiledBlock19.java:149)
at org.jruby.runtime.Block.yieldArray(Block.java:146)
at org.jruby.ext.fiber.ThreadFiber$1.run(ThreadFiber.java:37)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
When running with: -Xerrno.backtrace=true (which forces all errors to generate a backtrace)
I still get a crash.
java.lang.NullPointerException
at org.jruby.runtime.ThreadContext.gatherCallerBacktrace(ThreadContext.java:755)
at org.jruby.runtime.ThreadContext.createCallerBacktrace(ThreadContext.java:726)
at org.jruby.RubyThread.backtrace(RubyThread.java:973)
at org.jruby.RubyThread$INVOKER$i$0$0$backtrace.call(RubyThread$INVOKER$i$0$0$backtrace.gen)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:134)
at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:64)
at org.jruby.ast.CallTwoArgNode.interpret(CallTwoArgNode.java:59)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:182)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:188)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)
at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
at org.jruby.ast.IfNode.interpret(IfNode.java:118)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
at org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:209)
at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:160)
at org.jruby.runtime.Block.yield(Block.java:130)
at org.jruby.RubyArray.eachCommon(RubyArray.java:1606)
at org.jruby.RubyArray.each(RubyArray.java:1613)
at org.jruby.RubyArray$INVOKER$i$0$0$each.call(RubyArray$INVOKER$i$0$0$each.gen)
at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:143)
at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:154)
at org.jruby.ast.CallNoArgBlockNode.interpret(CallNoArgBlockNode.java:64)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:172)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:134)
at org.jruby.ast.VCallNode.interpret(VCallNode.java:88)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:161)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:180)
at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:143)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:149)
at org.jruby.RubyClass.newInstance(RubyClass.java:848)
at org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)
at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroOrNBlock.call(JavaMethod.java:261)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:134)
at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:64)
at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:172)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:134)
at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:64)
at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:172)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:134)
at org.jruby.ast.VCallNode.interpret(VCallNode.java:88)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
at org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:209)
at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:160)
at org.jruby.runtime.Interpreted19Block.yieldSpecific(Interpreted19Block.java:133)
at org.jruby.runtime.Block.yieldSpecific(Block.java:99)
at org.jruby.runtime.invokedynamic.InvocationLinker.yieldSpecificFallback(InvocationLinker.java:399)
at rubyjit.Celluloid::TaskFiber$$initialize_6A8830911B6F369CFF4DCAFBBA5A5D41AA8F014C424058530.chained_1_rescue_1$RUBY$SYNTHETIC__file__(/Users/cremes/.rvm/gems/jruby-1.7.2/gems/celluloid-0.13.0.pre/lib/celluloid/tasks/task_fiber.rb:28)
at rubyjit.Celluloid::TaskFiber$$initialize_6A8830911B6F369CFF4DCAFBBA5A5D41AA8F014C424058530.chained_0_ensure_1$RUBY$__ensure__(/Users/cremes/.rvm/gems/jruby-1.7.2/gems/celluloid-0.13.0.pre/lib/celluloid/tasks/task_fiber.rb)
at rubyjit.Celluloid::TaskFiber$$initialize_6A8830911B6F369CFF4DCAFBBA5A5D41AA8F014C424058530.block_0$RUBY$__file__(/Users/cremes/.rvm/gems/jruby-1.7.2/gems/celluloid-0.13.0.pre/lib/celluloid/tasks/task_fiber.rb:27)
at rubyjit$Celluloid::TaskFiber$$initialize_6A8830911B6F369CFF4DCAFBBA5A5D41AA8F014C424058530$block_0$RUBY$__file__.call(rubyjit$Celluloid::TaskFiber$$initialize_6A8830911B6F369CFF4DCAFBBA5A5D41AA8F014C424058530$block_0$RUBY$__file__)
at org.jruby.runtime.CompiledBlock19.yield(CompiledBlock19.java:163)
at org.jruby.runtime.CompiledBlock19.yield(CompiledBlock19.java:149)
at org.jruby.runtime.Block.yieldArray(Block.java:146)
at org.jruby.ext.fiber.ThreadFiber$1.run(ThreadFiber.java:37)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment