Hi,
I’m looking for workaround for an interesting problem I have. Or some
explanation why this can happen so I can think about workaround.
For certain data (I’m still unable to figure out what is offending
part),
calling YAML.dump in jruby is crashing jruby process with
the following stack which start with “*
org.yecht.Emitter.scanScalar(Emitter.java:446)*” (full stack is
attached).
The offending data is just a simple json object - relatively big.
The problem is that I this error crashes the entire process - even
putting begin/rescue does not help.
So I have two questions:
-
Is there some way to protect my jruby process
from completely crashing? -
What could be causing the error like this in YAML.dump?
(Unfortunately, the data which causes this problem is client’s data
so I
cannot share with it - I’m still trying to figure out what is
offending
part).
Thanks,
KB
P.S. Here is the stack trace:
ERROR: 209
org.yecht.Emitter.scanScalar(Emitter.java:446)
org.yecht.Emitter.emitScalar(Emitter.java:503)
org.yecht.ruby.RubyEmitterHandler.handle(RubyEmitterHandler.java:42)
org.yecht.Emitter.emit(Emitter.java:280)
org.yecht.Emitter.emitItem(Emitter.java:949)
org.yecht.ruby.RubyEmitterHandler.handle(RubyEmitterHandler.java:28)
org.yecht.Emitter.emit(Emitter.java:280)
org.yecht.Emitter.emitItem(Emitter.java:949)
org.yecht.ruby.RubyEmitterHandler.handle(RubyEmitterHandler.java:36)
org.yecht.Emitter.emit(Emitter.java:280)
org.yecht.Emitter.emitItem(Emitter.java:949)
org.yecht.ruby.RubyEmitterHandler.handle(RubyEmitterHandler.java:28)
org.yecht.Emitter.emit(Emitter.java:280)
org.yecht.Emitter.emitItem(Emitter.java:949)
org.yecht.ruby.RubyEmitterHandler.handle(RubyEmitterHandler.java:28)
org.yecht.Emitter.emit(Emitter.java:280)
org.yecht.ruby.YEmitter.emit(YEmitter.java:115)
org.yecht.ruby.YEmitter$s$0$1$emit_DBG.call(YEmitter$s$0$1$emit_DBG.gen:65535)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:211)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:176)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:182)
org.jruby.ast.CallOneArgBlockPassNode.interpret(CallOneArgBlockPassNode.java:60)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:255)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:210)
org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:221)
org.jruby.ast.CallTwoArgBlockNode.interpret(CallTwoArgBlockNode.java:62)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:190)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:167)
org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:190)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:167)
org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
org.jruby.ast.CallTwoArgNode.interpret(CallTwoArgNode.java:59)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:111)
org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:374)
org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:295)
org.jruby.runtime.InterpretedBlock.yieldSpecific(InterpretedBlock.java:229)
org.jruby.runtime.Block.yieldSpecific(Block.java:99)
org.jruby.ast.ZYieldNode.interpret(ZYieldNode.java:25)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:169)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:142)
org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:153)
org.jruby.ast.FCallNoArgBlockNode.interpret(FCallNoArgBlockNode.java:32)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:233)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:201)
org.jruby.ast.CallTwoArgNode.interpret(CallTwoArgNode.java:59)
org.jruby.ast.RescueNode.executeBody(RescueNode.java:216)
org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:120)
org.jruby.ast.RescueNode.interpret(RescueNode.java:110)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.ast.IfNode.interpret(IfNode.java:117)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.ast.IfNode.interpret(IfNode.java:117)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.ast.RescueNode.executeBody(RescueNode.java:216)
org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:120)
org.jruby.ast.RescueNode.interpret(RescueNode.java:110)
org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:190)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:167)
org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:120)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:134)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:69)
org.jruby.ast.FCallManyArgsNode.interpret(FCallManyArgsNode.java:60)
org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.ast.IfNode.interpret(IfNode.java:117)
org.jruby.ast.IfNode.interpret(IfNode.java:119)
org.jruby.ast.IfNode.interpret(IfNode.java:119)
org.jruby.ast.IfNode.interpret(IfNode.java:119)
org.jruby.ast.IfNode.interpret(IfNode.java:119)
org.jruby.ast.IfNode.interpret(IfNode.java:119)
org.jruby.ast.IfNode.interpret(IfNode.java:119)
org.jruby.ast.IfNode.interpret(IfNode.java:119)
org.jruby.ast.IfNode.interpret(IfNode.java:119)
org.jruby.ast.IfNode.interpret(IfNode.java:119)
org.jruby.ast.IfNode.interpret(IfNode.java:119)
org.jruby.ast.IfNode.interpret(IfNode.java:119)
org.jruby.ast.IfNode.interpret(IfNode.java:119)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.ast.RescueNode.executeBody(RescueNode.java:216)
org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:120)
org.jruby.ast.RescueNode.interpret(RescueNode.java:110)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:233)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:201)
org.jruby.ast.FCallTwoArgNode.interpret(FCallTwoArgNode.java:38)
org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.ast.IfNode.interpret(IfNode.java:117)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:233)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:332)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:203)
org.jruby.ast.CallTwoArgNode.interpret(CallTwoArgNode.java:59)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:111)
org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:374)
org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:295)
org.jruby.runtime.InterpretedBlock.yieldSpecific(InterpretedBlock.java:229)
org.jruby.runtime.Block.yieldSpecific(Block.java:99)
org.jruby.ast.ZYieldNode.interpret(ZYieldNode.java:25)
org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:212)
org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:176)
org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:187)
org.jruby.ast.FCallOneArgBlockNode.interpret(FCallOneArgBlockNode.java:34)
org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.ast.IfNode.interpret(IfNode.java:119)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:233)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:201)
org.jruby.ast.FCallTwoArgNode.interpret(FCallTwoArgNode.java:38)
org.jruby.ast.DAsgnNode.interpret(DAsgnNode.java:110)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:111)
org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:374)
org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:295)
org.jruby.runtime.InterpretedBlock.yieldSpecific(InterpretedBlock.java:229)
org.jruby.runtime.Block.yieldSpecific(Block.java:99)
org.jruby.ast.ZYieldNode.interpret(ZYieldNode.java:25)
org.jruby.ast.DAsgnNode.interpret(DAsgnNode.java:110)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
org.jruby.ast.RescueNode.executeBody(RescueNode.java:216)
org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:120)
org.jruby.ast.RescueNode.interpret(RescueNode.java:110)
org.jruby.ast.EnsureNode.interpret(EnsureNode.java:96)
org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:111)
org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:374)
org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:328)
org.jruby.runtime.BlockBody.call(BlockBody.java:73)
org.jruby.runtime.Block.call(Block.java:89)
org.jruby.RubyProc.call(RubyProc.java:270)
org.jruby.RubyProc.call(RubyProc.java:224)
org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:95)
java.lang.Thread.run(Thread.java:722)