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

NullPointerException in XmlSaxPushParser#native_write triggered by fix for #1261 #1710

Closed
chewi opened this issue Jan 16, 2018 · 24 comments · Fixed by #1717 or #1748
Closed

NullPointerException in XmlSaxPushParser#native_write triggered by fix for #1261 #1710

chewi opened this issue Jan 16, 2018 · 24 comments · Fixed by #1717 or #1748

Comments

@chewi
Copy link

chewi commented Jan 16, 2018

The last remaining 15 Blather test failures are caused @yokolet's fix for #1261 in 3b121ca. I'm not sure exactly what triggers it but sometimes parserTask.parser.getNokogiriHandler() returns null, leading to a NullPointerException.

Reverting the change allows all the Blather tests to pass. So does skipping the try block if the handler is null. Strangely changing SAXException to just Exception in the catch clause also makes it work. I'm not sure what the correct fix would be, though presumably reverting the change isn't the way to go.

@flavorjones
Copy link
Member

@jvshahid @yokolet @mbklein @kares Anybody have an opinion on what to do here?

@kares
Copy link
Contributor

kares commented Jan 29, 2018

Reverting the change allows all the Blather tests to pass. So does skipping the try block if the handler is null. Strangely changing SAXException to just Exception in the catch clause also makes it work. I'm not sure what the correct fix would be, though presumably reverting the change isn't the way to go.

since you're catching the NPE with the Exception as well - it should not be strange but expected.

ideally - just follow the usual way - setup a reproducer within Nokogiri's tests where one can observe the NPE, from there one can reason whether catching all exceptions is legit (or maybe catching NPE explicitly with an explanation works better).

having a stack trace around here might have been useful as well (if for nothing else - at least for search engines to index and guide additional traffic here).

@chewi
Copy link
Author

chewi commented Jan 29, 2018

since you're catching the NPE with the Exception as well - it should not be strange but expected.

I thought it was strange because the catch clause reraises it as a Ruby exception but I never see that.

I would have produced a test case but Blather is quite complex and I could not determine what these 15 test cases had in common that caused it do this. I can provide a stack trace though. This is against d35ed46.

Failure/Error: Unable to find nokogiri.XmlSaxPushParser.native_write(XmlSaxPushParser.java to read failed line
Java::JavaLang::NullPointerException:
# nokogiri.XmlSaxPushParser.native_write(XmlSaxPushParser.java:158)
# nokogiri.XmlSaxPushParser$INVOKER$i$2$0$native_write.call(XmlSaxPushParser$INVOKER$i$2$0$native_write.gen)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:181)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:324)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:90)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:214)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:200)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:208)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:338)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:183)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:324)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:78)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:144)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:130)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:192)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:298)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:127)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:344)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:78)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:144)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:130)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:192)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:298)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:127)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:344)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
# org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
# org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:193)
# org.jruby.runtime.BlockBody.yield(BlockBody.java:125)
# org.jruby.runtime.Block.yieldNonArray(Block.java:169)
# org.jruby.RubyBasicObject.yieldUnder(RubyBasicObject.java:1751)
# org.jruby.RubyBasicObject.instance_exec19(RubyBasicObject.java:1728)
# org.jruby.RubyBasicObject$INVOKER$i$0$3$instance_exec19.call(RubyBasicObject$INVOKER$i$0$3$instance_exec19.gen)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:77)
# org.jruby.ir.instructions.CallBase.interpret(CallBase.java:432)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:84)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:328)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:165)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:337)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:84)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:155)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:315)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
# org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
# org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:186)
# org.jruby.runtime.BlockBody.yield(BlockBody.java:116)
# org.jruby.runtime.Block.yield(Block.java:165)
# org.jruby.RubyArray.each(RubyArray.java:1735)
# org.jruby.RubyArray$INVOKER$i$0$0$each.call(RubyArray$INVOKER$i$0$0$each.gen)
# org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroBlock.call(JavaMethod.java:498)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:77)
# org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:84)
# org.jruby.ir.instructions.CallBase.interpret(CallBase.java:429)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:77)
# org.jruby.ir.instructions.CallBase.interpret(CallBase.java:432)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
# org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
# org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:186)
# org.jruby.runtime.BlockBody.yield(BlockBody.java:116)
# org.jruby.runtime.Block.yield(Block.java:165)
# org.jruby.RubyArray.each(RubyArray.java:1735)
# org.jruby.RubyArray$INVOKER$i$0$0$each.call(RubyArray$INVOKER$i$0$0$each.gen)
# org.jruby.RubyClass.finvoke(RubyClass.java:512)
# org.jruby.RubyBasicObject.send19(RubyBasicObject.java:1664)
# org.jruby.RubyBasicObject$INVOKER$i$send19.call(RubyBasicObject$INVOKER$i$send19.gen)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:163)
# org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:170)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:336)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:278)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:79)
# org.jruby.ir.instructions.CallBase.interpret(CallBase.java:432)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:278)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:79)
# org.jruby.ir.instructions.CallBase.interpret(CallBase.java:432)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:78)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:144)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:130)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:192)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:298)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:127)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:344)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
# org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
# org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:84)
# org.jruby.runtime.Block.yieldSpecific(Block.java:134)
# org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:420)
# org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:74)
# org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:213)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:123)
# org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
# org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
# org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:84)
# org.jruby.runtime.Block.yieldSpecific(Block.java:134)
# org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:420)
# org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:74)
# org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:213)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:123)
# org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
# org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
# org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:84)
# org.jruby.runtime.Block.yieldSpecific(Block.java:134)
# org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:420)
# org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:74)
# org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:213)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:123)
# org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
# org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
# org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:84)
# org.jruby.runtime.Block.yieldSpecific(Block.java:134)
# org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:420)
# org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:74)
# org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:213)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:123)
# org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:84)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:328)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:165)
# org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:170)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:336)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:278)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:79)
# org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:84)
# org.jruby.ir.instructions.CallBase.interpret(CallBase.java:429)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:278)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:79)
# org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:84)
# org.jruby.ir.instructions.CallBase.interpret(CallBase.java:429)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:278)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:79)
# org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:84)
# org.jruby.ir.instructions.CallBase.interpret(CallBase.java:429)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:90)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:214)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:200)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:208)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:338)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:183)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:324)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
# org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
# org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:186)
# org.jruby.runtime.BlockBody.yield(BlockBody.java:116)
# org.jruby.runtime.Block.yield(Block.java:165)
# org.jruby.RubyArray.collect(RubyArray.java:2473)
# org.jruby.RubyArray.map19(RubyArray.java:2487)
# org.jruby.RubyArray$INVOKER$i$0$0$map19.call(RubyArray$INVOKER$i$0$0$map19.gen)
# org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroBlock.call(JavaMethod.java:498)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:278)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:79)
# org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:84)
# org.jruby.ir.instructions.CallBase.interpret(CallBase.java:429)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:84)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:155)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:315)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:84)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:155)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:315)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
# org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
# org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:186)
# org.jruby.runtime.BlockBody.yield(BlockBody.java:116)
# org.jruby.runtime.Block.yield(Block.java:165)
# org.jruby.RubyArray.collect(RubyArray.java:2473)
# org.jruby.RubyArray.map19(RubyArray.java:2487)
# org.jruby.RubyArray$INVOKER$i$0$0$map19.call(RubyArray$INVOKER$i$0$0$map19.gen)
# org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroBlock.call(JavaMethod.java:498)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:278)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:79)
# org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:84)
# org.jruby.ir.instructions.CallBase.interpret(CallBase.java:429)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
# org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
# org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:84)
# org.jruby.runtime.Block.yieldSpecific(Block.java:134)
# org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:420)
# org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:74)
# org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:213)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:123)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:278)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:79)
# org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:84)
# org.jruby.ir.instructions.CallBase.interpret(CallBase.java:429)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
# org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
# org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:186)
# org.jruby.runtime.BlockBody.yield(BlockBody.java:116)
# org.jruby.runtime.Block.yield(Block.java:165)
# org.jruby.ir.runtime.IRRuntimeHelpers.yield(IRRuntimeHelpers.java:416)
# org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:83)
# org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:213)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:123)
# org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:84)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:328)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:165)
# org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:170)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:336)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:84)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:155)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:315)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:90)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:214)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:200)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:208)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:338)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:183)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:324)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:278)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:79)
# org.jruby.ir.instructions.CallBase.interpret(CallBase.java:432)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:78)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:144)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:130)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:192)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:298)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:127)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:344)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.Interpreter.INTERPRET_ROOT(Interpreter.java:112)
# org.jruby.ir.interpreter.Interpreter.execute(Interpreter.java:99)
# org.jruby.ir.interpreter.Interpreter.execute(Interpreter.java:35)
# org.jruby.ir.IRTranslator.execute(IRTranslator.java:42)
# org.jruby.Ruby.runInterpreter(Ruby.java:843)
# org.jruby.Ruby.loadFile(Ruby.java:2889)
# org.jruby.runtime.load.LibrarySearcher$ResourceLibrary.load(LibrarySearcher.java:243)
# org.jruby.runtime.load.LibrarySearcher$FoundLibrary.load(LibrarySearcher.java:34)
# org.jruby.runtime.load.LoadService.load(LoadService.java:343)
# org.jruby.RubyKernel.loadCommon(RubyKernel.java:981)
# org.jruby.RubyKernel.load19(RubyKernel.java:973)
# org.jruby.RubyKernel$INVOKER$s$0$1$load19.call(RubyKernel$INVOKER$s$0$1$load19.gen)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:204)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:155)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:315)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.Interpreter.INTERPRET_EVAL(Interpreter.java:122)
# org.jruby.ir.interpreter.Interpreter.evalCommon(Interpreter.java:176)
# org.jruby.ir.interpreter.Interpreter.evalWithBinding(Interpreter.java:200)
# org.jruby.RubyKernel.evalCommon(RubyKernel.java:1027)
# org.jruby.RubyKernel.eval19(RubyKernel.java:994)
# org.jruby.RubyKernel$INVOKER$s$0$3$eval19.call(RubyKernel$INVOKER$s$0$3$eval19.gen)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:220)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:216)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:358)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:211)
# java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
# org.jruby.ir.Compiler$1.load(Compiler.java:95)
# org.jruby.Ruby.runScript(Ruby.java:831)
# org.jruby.Ruby.runNormally(Ruby.java:750)
# org.jruby.Ruby.runNormally(Ruby.java:768)
# org.jruby.Ruby.runFromMain(Ruby.java:581)
# org.jruby.Main.doRunFromMain(Main.java:417)
# org.jruby.Main.internalRun(Main.java:305)
# org.jruby.Main.run(Main.java:232)
# org.jruby.Main.main(Main.java:204)

@jvshahid
Copy link
Member

jvshahid commented Jan 30, 2018 via email

@chewi
Copy link
Author

chewi commented Jan 31, 2018

Thanks @jvshahid but unfortunately your changes only fix 3 of the 15 failures in Blather and the error message has now changed.

Failure/Error: Unable to find nokogiri.internals.NokogiriHandler.populateCharacters(NokogiriHandler.java to read failed line
Java::JavaLang::NullPointerException:
# nokogiri.internals.NokogiriHandler.populateCharacters(NokogiriHandler.java:342)
# nokogiri.internals.NokogiriHandler.endDocument(NokogiriHandler.java:115)
# nokogiri.XmlSaxPushParser.native_write(XmlSaxPushParser.java:171)
# nokogiri.XmlSaxPushParser$INVOKER$i$2$0$native_write.call(XmlSaxPushParser$INVOKER$i$2$0$native_write.gen)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:181)
# home.jlecuirot.Open.nokogiri.lib.nokogiri.xml.sax.push_parser.invokeOther0:native_write(/home/jlecuirot/Open/nokogiri/lib/nokogiri/xml/sax/push_parser.rb:47)
# home.jlecuirot.Open.nokogiri.lib.nokogiri.xml.sax.push_parser.RUBY$method$write$0(/home/jlecuirot/Open/nokogiri/lib/nokogiri/xml/sax/push_parser.rb:47)
# org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:77)
# org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:113)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:198)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:208)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:181)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:324)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:78)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:144)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:130)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:192)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:125)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:344)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:78)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:144)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:130)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:192)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:125)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:344)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:78)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:144)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:130)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:192)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:298)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:127)
# home.jlecuirot.$_dot_rvm.gems.jruby_minus_9_dot_1_dot_15_dot_0_at_40_blather.gems.eventmachine_minus_1_dot_0_dot_9_dot_1_minus_java.lib.eventmachine.invokeOther14:unbind(/home/jlecuirot/.rvm/gems/jruby-9.1.15.0@blather/gems/eventmachine-1.0.9.1-java/lib/eventmachine.rb:1470)
# home.jlecuirot.$_dot_rvm.gems.jruby_minus_9_dot_1_dot_15_dot_0_at_40_blather.gems.eventmachine_minus_1_dot_0_dot_9_dot_1_minus_java.lib.eventmachine.RUBY$method$event_callback$0(/home/jlecuirot/.rvm/gems/jruby-9.1.15.0@blather/gems/eventmachine-1.0.9.1-java/lib/eventmachine.rb:1470)
# org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:129)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:233)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:216)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:209)
# home.jlecuirot.$_dot_rvm.gems.jruby_minus_9_dot_1_dot_15_dot_0_at_40_blather.gems.eventmachine_minus_1_dot_0_dot_9_dot_1_minus_java.lib.jeventmachine.invokeOther5:event_callback(/home/jlecuirot/.rvm/gems/jruby-9.1.15.0@blather/gems/eventmachine-1.0.9.1-java/lib/jeventmachine.rb:92)
# home.jlecuirot.$_dot_rvm.gems.jruby_minus_9_dot_1_dot_15_dot_0_at_40_blather.gems.eventmachine_minus_1_dot_0_dot_9_dot_1_minus_java.lib.jeventmachine.RUBY$method$eventCallback$0(/home/jlecuirot/.rvm/gems/jruby-9.1.15.0@blather/gems/eventmachine-1.0.9.1-java/lib/jeventmachine.rb:92)
# home.jlecuirot.$_dot_rvm.gems.jruby_minus_9_dot_1_dot_15_dot_0_at_40_blather.gems.eventmachine_minus_1_dot_0_dot_9_dot_1_minus_java.lib.jeventmachine.RUBY$method$eventCallback$0$__VARARGS__(/home/jlecuirot/.rvm/gems/jruby-9.1.15.0@blather/gems/eventmachine-1.0.9.1-java/lib/jeventmachine.rb)
# org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:77)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:93)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:174)
# org.jruby.javasupport.proxy.JavaProxyConstructor$MethodInvocationHandler.invokeRuby(JavaProxyConstructor.java:255)
# org.jruby.javasupport.proxy.JavaProxyConstructor$MethodInvocationHandler.invoke(JavaProxyConstructor.java:238)
# org.jruby.proxy.com.rubyeventmachine.EmReactor$Proxy1.eventCallback(Unknown Source)
# com.rubyeventmachine.EmReactor.eventCallback(EmReactor.java:89)
# org.jruby.proxy.com.rubyeventmachine.EmReactor$Proxy1.__super$eventCallback(Unknown Source)
# sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
# sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
# java.lang.reflect.Method.invoke(Method.java:498)
# org.jruby.javasupport.JavaMethod.invokeDirectSuperWithExceptionHandling(JavaMethod.java:408)
# org.jruby.javasupport.JavaMethod.tryProxyInvocation(JavaMethod.java:611)
# org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:287)
# org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:28)
# org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:90)
# org.jruby.RubyClass.finvoke(RubyClass.java:522)
# org.jruby.runtime.Helpers.invokeAs(Helpers.java:434)
# org.jruby.javasupport.proxy.JavaProxyConstructor$MethodInvocationHandler.invokeRuby(JavaProxyConstructor.java:260)
# org.jruby.javasupport.proxy.JavaProxyConstructor$MethodInvocationHandler.invoke(JavaProxyConstructor.java:238)
# org.jruby.proxy.com.rubyeventmachine.EmReactor$Proxy1.eventCallback(Unknown Source)
# com.rubyeventmachine.EmReactor.close(EmReactor.java:331)
# com.rubyeventmachine.EmReactor.run(EmReactor.java:114)
# sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
# sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
# java.lang.reflect.Method.invoke(Method.java:498)
# org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:438)
# org.jruby.javasupport.JavaMethod.tryProxyInvocation(JavaMethod.java:623)
# org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:299)
# org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:36)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:125)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:344)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:78)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:144)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:130)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:192)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:298)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:127)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:344)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:278)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:79)
# org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:84)
# org.jruby.ir.instructions.CallBase.interpret(CallBase.java:429)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:84)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:328)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:165)
# org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:170)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:336)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
# org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
# org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:193)
# org.jruby.runtime.BlockBody.yield(BlockBody.java:125)
# org.jruby.runtime.Block.yieldNonArray(Block.java:169)
# org.jruby.RubyBasicObject.yieldUnder(RubyBasicObject.java:1751)
# org.jruby.RubyBasicObject.instance_exec19(RubyBasicObject.java:1728)
# org.jruby.RubyBasicObject$INVOKER$i$0$3$instance_exec19.call(RubyBasicObject$INVOKER$i$0$3$instance_exec19.gen)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:204)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:328)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:165)
# org.jruby.runtime.CompiledIRBlockBody.yieldDirect(CompiledIRBlockBody.java:156)
# org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:80)
# org.jruby.runtime.Block.yieldSpecific(Block.java:134)
# org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:420)
# org.jruby.ir.targets.YieldSite.yieldSpecific(YieldSite.java:114)
# org.jruby.runtime.CompiledIRBlockBody.yieldDirect(CompiledIRBlockBody.java:156)
# org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:80)
# org.jruby.runtime.Block.yieldSpecific(Block.java:134)
# org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:420)
# org.jruby.ir.targets.YieldSite.yieldSpecific(YieldSite.java:114)
# org.jruby.runtime.CompiledIRBlockBody.yieldDirect(CompiledIRBlockBody.java:156)
# org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:80)
# org.jruby.runtime.Block.yieldSpecific(Block.java:134)
# org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:420)
# org.jruby.ir.targets.YieldSite.yieldSpecific(YieldSite.java:114)
# org.jruby.runtime.CompiledIRBlockBody.yieldDirect(CompiledIRBlockBody.java:156)
# org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:80)
# org.jruby.runtime.Block.yieldSpecific(Block.java:134)
# org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:420)
# org.jruby.ir.targets.YieldSite.yieldSpecific(YieldSite.java:114)
# org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:103)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:163)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:163)
# org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:170)
# org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:129)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:233)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:219)
# org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:226)
# org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:90)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:128)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:135)
# org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:142)
# org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:90)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:128)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:135)
# org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:142)
# org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:116)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:198)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:208)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:181)
# org.jruby.runtime.CompiledIRBlockBody.yieldDirect(CompiledIRBlockBody.java:156)
# org.jruby.runtime.BlockBody.yield(BlockBody.java:114)
# org.jruby.runtime.Block.yield(Block.java:165)
# org.jruby.RubyArray.collect(RubyArray.java:2473)
# org.jruby.RubyArray.map19(RubyArray.java:2487)
# org.jruby.RubyArray$INVOKER$i$0$0$map19.call(RubyArray$INVOKER$i$0$0$map19.gen)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:135)
# org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:142)
# org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:103)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:163)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:155)
# org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:77)
# org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:100)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:163)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:155)
# org.jruby.runtime.CompiledIRBlockBody.yieldDirect(CompiledIRBlockBody.java:156)
# org.jruby.runtime.BlockBody.yield(BlockBody.java:114)
# org.jruby.runtime.Block.yield(Block.java:165)
# org.jruby.RubyArray.collect(RubyArray.java:2473)
# org.jruby.RubyArray.map19(RubyArray.java:2487)
# org.jruby.RubyArray$INVOKER$i$0$0$map19.call(RubyArray$INVOKER$i$0$0$map19.gen)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:135)
# org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:142)
# org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:77)
# org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:100)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:163)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:155)
# org.jruby.runtime.CompiledIRBlockBody.yieldDirect(CompiledIRBlockBody.java:156)
# org.jruby.runtime.MixedModeIRBlockBody.yieldDirect(MixedModeIRBlockBody.java:122)
# org.jruby.runtime.BlockBody.yield(BlockBody.java:114)
# org.jruby.runtime.Block.yield(Block.java:165)
# org.jruby.RubyArray.collect(RubyArray.java:2473)
# org.jruby.RubyArray.map19(RubyArray.java:2487)
# org.jruby.RubyArray$INVOKER$i$0$0$map19.call(RubyArray$INVOKER$i$0$0$map19.gen)
# org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroBlock.call(JavaMethod.java:498)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:278)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:79)
# org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:84)
# org.jruby.ir.instructions.CallBase.interpret(CallBase.java:429)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
# org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
# org.jruby.runtime.IRBlockBody.yieldSpecific(IRBlockBody.java:84)
# org.jruby.runtime.Block.yieldSpecific(Block.java:134)
# org.jruby.ir.runtime.IRRuntimeHelpers.yieldSpecific(IRRuntimeHelpers.java:420)
# org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:74)
# org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:213)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:123)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:278)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:79)
# org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:84)
# org.jruby.ir.instructions.CallBase.interpret(CallBase.java:429)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:132)
# org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:148)
# org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:186)
# org.jruby.runtime.BlockBody.yield(BlockBody.java:116)
# org.jruby.runtime.Block.yield(Block.java:165)
# org.jruby.ir.runtime.IRRuntimeHelpers.yield(IRRuntimeHelpers.java:416)
# org.jruby.ir.instructions.YieldInstr.interpret(YieldInstr.java:83)
# org.jruby.ir.interpreter.StartupInterpreterEngine.processOtherOp(StartupInterpreterEngine.java:213)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:123)
# org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:84)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:328)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:165)
# org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:170)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:336)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:84)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:179)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:165)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:155)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:315)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:90)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:214)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:200)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:208)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:338)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:183)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:324)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:109)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:95)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:278)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:79)
# org.jruby.ir.instructions.CallBase.interpret(CallBase.java:432)
# org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
# org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:74)
# org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:78)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:144)
# org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:130)
# org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:192)
# org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:298)
# org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:127)
# java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
# org.jruby.ir.Compiler$1.load(Compiler.java:95)
# org.jruby.Ruby.runScript(Ruby.java:831)
# org.jruby.Ruby.runNormally(Ruby.java:750)
# org.jruby.Ruby.runNormally(Ruby.java:768)
# org.jruby.Ruby.runFromMain(Ruby.java:581)
# org.jruby.Main.doRunFromMain(Main.java:417)
# org.jruby.Main.internalRun(Main.java:305)
# org.jruby.Main.run(Main.java:232)
# org.jruby.Main.main(Main.java:204)

@jvshahid
Copy link
Member

jvshahid commented Jan 31, 2018 via email

@chewi
Copy link
Author

chewi commented Jan 31, 2018

Pretty sure it's the right branch at commit 090563c and with your other fix for #1708 cherry-picked on top (otherwise I'd get a lot more errors).

Blather master is broken in other ways and I have fixes locally, the main one being that EventMachine needs to be pinned back to ~> 1.0.9. I was trying to get this issue resolved before pushing everything up. I'll see what I can do.

@chewi
Copy link
Author

chewi commented Jan 31, 2018

For now, I've just pushed up what I have to my new-nokogiri branch. Hope that helps.

@chewi
Copy link
Author

chewi commented Feb 19, 2018

@flavorjones, this isn't resolved yet. While #1717 seemed to help a little, I am still seeing test failures.

@chewi
Copy link
Author

chewi commented Feb 22, 2018

Just ran the Blather tests against master to double check. Definitely still an issue.

@jvshahid
Copy link
Member

I haven't ran the Blather tests in a while. Out of curiosity how many failures are you getting now ?

@chewi
Copy link
Author

chewi commented Feb 22, 2018

The same 12 I mentioned previously so you have fixed 3 since I originally reported this. If you use my new-nokogiri branch then you should be able to run the suite without the problems you experienced before.

@flavorjones flavorjones reopened this Feb 25, 2018
@chewi
Copy link
Author

chewi commented Mar 5, 2018

I thought I should check whether #1721 helps now that it's been merged as it changes the code mentioned above. The failures remain and it also breaks my suggested fixes. It now gets parserTask.getNokogiriHandler() rather than parserTask.parser.getNokogiriHandler() and checking for null here is no longer effective. parserTask.parser is also protected so I can't use that now.

@flavorjones
Copy link
Member

@kares do you have some time to dig in on this issue?

@chewi
Copy link
Author

chewi commented Mar 29, 2018

I think I got it! It's hard to explain how I got here (fun with EventMachine) but this fixes everything:

diff --git a/ext/java/nokogiri/internals/NokogiriHandler.java b/ext/java/nokogiri/internals/NokogiriHandler.java
index 1969a604..35b7d597 100644
--- a/ext/java/nokogiri/internals/NokogiriHandler.java
+++ b/ext/java/nokogiri/internals/NokogiriHandler.java
@@ -322,7 +322,7 @@ public class NokogiriHandler extends DefaultHandler2 implements XmlDeclHandler {
     }
 
     protected void populateCharacters() {
-        if (charactersBuilder.length() > 0) {
+        if (charactersBuilder != null && charactersBuilder.length() > 0) {
             call("characters", runtime.newString(charactersBuilder.toString()));
             charactersBuilder.setLength(0);
         }

Should it ever be in this state to begin with? I don't know but hopefully you can reason it through.

@flavorjones
Copy link
Member

@jvshahid any thoughts?

@jvshahid
Copy link
Member

That makes sense since charactersBuilder is only initialized in startDocument. I'm still confused why startDocument isn't being called in those cases.I'm trying to come up with a test case

@jvshahid
Copy link
Member

I was able to reproduce this with empty documents, i.e. parser.write "", true. I'm wrapping up a pr atm

@jvshahid
Copy link
Member

opened #1748

@jvshahid
Copy link
Member

@chewi out of curiosity do you see this error message on MRI Nokogiri::XML::SyntaxError: 1:1: FATAL: Extra content at the end of the document. libxml will return that error if the input is closed before start_document is called.

@chewi
Copy link
Author

chewi commented Mar 29, 2018

Pretty sure everything has been passing for ages on MRI but I'll double check against master tomorrow. Many thanks again for your help.

@chewi
Copy link
Author

chewi commented Mar 30, 2018

Tested MRI and don't see that error. I can see in Nokogiri::XML::SAX::PushParser#finish where it calls write '', true, which leads to end_document but the call to start_document is buried within org.xml.sax and libxml2. Perhaps org.xml.sax is lazier than libxml2 in how it calls start_document.

@jvshahid
Copy link
Member

@chewi i think you would if you removed this line. Anyway, I'm convinced that the PR fixes the root cause of he NPE. I will change the PR so that both implementation have the same behavior when parser.finish is called without any data

@chewi
Copy link
Author

chewi commented Mar 30, 2018

You are indeed correct. Not being the original author, I unfortunately didn't spot that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants