truffleruby icon indicating copy to clipboard operation
truffleruby copied to clipboard

Instance of instrumentable node is not adopted by a parent

Open nirvdrum opened this issue 3 years ago • 0 comments

This looks like a Sulong exception, but I'm reporting it here to start. I ran into a case where an instrumentable node was not adopted by a parent while debugging a Rails application. I think the node corresponded to a Nokogiri call. It ended up killing the process and, by extension, the debugging session.

truffleruby: an internal exception escaped out of the interpreter, please report it to https://github.com/oracle/truffleruby/issues.

Ruby Thread id=106 from /home/spin/.bundle/u2/gems/puma-5.6.5/lib/puma/thread_pool.rb:104 terminated with internal error: (java.lang.RuntimeException)
        from org.truffleruby.core.thread.ThreadManager.printInternalError(ThreadManager.java:304)
        from org.truffleruby.core.thread.ThreadManager.threadMain(ThreadManager.java:292)
        from org.truffleruby.core.thread.ThreadManager.lambda$initialize$2(ThreadManager.java:262)
        from java.lang.Thread.run(Thread.java:829)
        from com.oracle.truffle.polyglot.PolyglotThread.access$001(PolyglotThread.java:53)
        from com.oracle.truffle.polyglot.PolyglotThread$1.execute(PolyglotThread.java:100)
        from com.oracle.truffle.polyglot.PolyglotThread$ThreadSpawnRootNode.executeImpl(PolyglotThread.java:134)
        from com.oracle.truffle.polyglot.PolyglotThread$ThreadSpawnRootNode.execute(PolyglotThread.java:125)
xpath.c:10764:in `xmlXPathCompMultiplicativeExpr'
        from xpath.c:10805:in `xmlXPathCompAdditiveExpr'
        from xpath.c:10843:in `xmlXPathCompRelationalExpr'
        from xpath.c:10882:in `xmlXPathCompEqualityExpr'
        from xpath.c:10913:in `xmlXPathCompAndExpr'
        from xpath.c:10951:in `xmlXPathCompileExpr'
        from xpath.c:14430:in `xmlXPathEvalExpr__internal_alias'
        from xpath.c:14470:in `xmlXPathEval__internal_alias'
        from xpath.c:14545:in `xmlXPathEvalExpression__internal_alias'
        from /home/spin/.bundle/u2/gems/nokogiri-1.13.8/ext/nokogiri/xml_xpath_context.c:342:in `evaluate'
        <...>
Caused by:
Instance of instrumentable node com.oracle.truffle.llvm.runtime.nodes.vars.LLVMReadNode$LLVMI1ReadNode is not adopted by a parent. (java.lang.IllegalStateException)
        from com.oracle.truffle.api.instrumentation.InstrumentationHandler.getWrapperNodeChecked(InstrumentationHandler.java:854)
        from com.oracle.truffle.api.instrumentation.InstrumentationHandler.insertWrapperImpl(InstrumentationHandler.java:832)
        from com.oracle.truffle.api.instrumentation.InstrumentationHandler.insertWrapper(InstrumentationHandler.java:806)
        from com.oracle.truffle.api.instrumentation.InstrumentationHandler$InsertWrapperOperation.perform(InstrumentationHandler.java:1322)
        from com.oracle.truffle.api.instrumentation.InstrumentationHandler$Visitor.visitInstrumentable(InstrumentationHandler.java:1976)
        from com.oracle.truffle.api.instrumentation.InstrumentationHandler$Visitor.visit(InstrumentationHandler.java:1783)
        from com.oracle.truffle.api.nodes.NodeUtil.forEachChild(NodeUtil.java:475)
        from com.oracle.truffle.api.instrumentation.InstrumentationHandler$Visitor.visit(InstrumentationHandler.java:1802)
        from com.oracle.truffle.api.nodes.NodeUtil.forEachChild(NodeUtil.java:486)
        from com.oracle.truffle.api.instrumentation.InstrumentationHandler$Visitor.visit(InstrumentationHandler.java:1802)
        from com.oracle.truffle.api.nodes.NodeUtil.forEachChild(NodeUtil.java:486)
        from com.oracle.truffle.api.instrumentation.InstrumentationHandler$Visitor.visit(InstrumentationHandler.java:1802)
        from com.oracle.truffle.api.nodes.NodeUtil.forEachChild(NodeUtil.java:475)
        from com.oracle.truffle.api.instrumentation.InstrumentationHandler$Visitor.visit(InstrumentationHandler.java:1802)
        from com.oracle.truffle.api.nodes.NodeUtil.forEachChild(NodeUtil.java:475)
        from com.oracle.truffle.api.instrumentation.InstrumentationHandler$Visitor.visit(InstrumentationHandler.java:1802)
        from com.oracle.truffle.api.instrumentation.InstrumentationHandler.visitRoot(InstrumentationHandler.java:1116)
        from com.oracle.truffle.api.instrumentation.InstrumentationHandler.onFirstExecution(InstrumentationHandler.java:209)
        from com.oracle.truffle.api.instrumentation.InstrumentAccessor$InstrumentImpl.onFirstExecution(InstrumentAccessor.java:197)
        from org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.initialize(OptimizedCallTarget.java:758)
        from org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.ensureInitialized(OptimizedCallTarget.java:741)
        from org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.interpreterCall(OptimizedCallTarget.java:575)
        from org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:562)
        from org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:549)
        from org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:495)
        from org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:68)
        from com.oracle.truffle.llvm.runtime.nodes.func.LLVMDispatchNode.doDirectCodeFast(LLVMDispatchNode.java:196)
        from com.oracle.truffle.llvm.runtime.nodes.func.LLVMDispatchNodeGen.executeAndSpecialize(LLVMDispatchNodeGen.java:275)
        from com.oracle.truffle.llvm.runtime.nodes.func.LLVMDispatchNodeGen.executeDispatch(LLVMDispatchNodeGen.java:234)
        from com.oracle.truffle.llvm.runtime.nodes.func.LLVMCallNode.doCall(LLVMCallNode.java:82)
        from com.oracle.truffle.llvm.runtime.nodes.func.LLVMCallNodeGen.executeGeneric(LLVMCallNodeGen.java:28)
        from com.oracle.truffle.llvm.runtime.nodes.api.LLVMExpressionNodeWrapper.executeGeneric(LLVMExpressionNodeWrapper.java:112)
        from com.oracle.truffle.llvm.runtime.nodes.api.LLVMVoidStatementNodeGen.execute(LLVMVoidStatementNodeGen.java:22)
        from com.oracle.truffle.llvm.runtime.nodes.base.LLVMBasicBlockNode$InitializedBlockNode.execute(LLVMBasicBlockNode.java:154)
        from com.oracle.truffle.llvm.runtime.nodes.control.LLVMDispatchBasicBlockNode.dispatchFromBasicBlock(LLVMDispatchBasicBlockNode.java:123)
        from com.oracle.truffle.llvm.runtime.nodes.control.LLVMDispatchBasicBlockNode.doDispatch(LLVMDispatchBasicBlockNode.java:90)
        from com.oracle.truffle.llvm.runtime.nodes.control.LLVMDispatchBasicBlockNodeGen.executeGeneric(LLVMDispatchBasicBlockNodeGen.java:24)
        from com.oracle.truffle.llvm.runtime.nodes.control.LLVMFunctionRootNode.doRun(LLVMFunctionRootNode.java:81)
        from com.oracle.truffle.llvm.runtime.nodes.control.LLVMFunctionRootNodeGen.executeGeneric(LLVMFunctionRootNodeGen.java:25)
        from com.oracle.truffle.llvm.runtime.nodes.api.LLVMExpressionNodeWrapper.executeGeneric(LLVMExpressionNodeWrapper.java:112)
        from com.oracle.truffle.llvm.runtime.nodes.func.LLVMFunctionStartNode.execute(LLVMFunctionStartNode.java:102)
xpath.c:10764:in `xmlXPathCompMultiplicativeExpr'
        from xpath.c:10805:in `xmlXPathCompAdditiveExpr'
        from xpath.c:10843:in `xmlXPathCompRelationalExpr'
        from xpath.c:10882:in `xmlXPathCompEqualityExpr'
        from xpath.c:10913:in `xmlXPathCompAndExpr'
        from xpath.c:10951:in `xmlXPathCompileExpr'
        from xpath.c:14430:in `xmlXPathEvalExpr__internal_alias'
        from xpath.c:14470:in `xmlXPathEval__internal_alias'
        from xpath.c:14545:in `xmlXPathEvalExpression__internal_alias'
        from /home/spin/.bundle/u2/gems/nokogiri-1.13.8/ext/nokogiri/xml_xpath_context.c:342:in `evaluate'
        from /home/spin/src/github.com/Shopify/graal/sdk/mxbuild/linux-amd64/GRAALVM_4C1C657FB2_JAVA11/graalvm-4c1c657fb2-java11-22.3.0-dev/languages/ruby/lib/truffle/truffle/cext_ruby.rb:41:in `evaluate'
        from /home/spin/.bundle/u2/gems/nokogiri-1.13.8/lib/nokogiri/xml/searchable.rb:233:in `xpath_impl'
        from /home/spin/.bundle/u2/gems/nokogiri-1.13.8/lib/nokogiri/xml/searchable.rb:214:in `xpath_internal'
        from /home/spin/.bundle/u2/gems/nokogiri-1.13.8/lib/nokogiri/xml/searchable.rb:177:in `xpath'
        from /home/spin/.bundle/u2/gems/nokogiri-1.13.8/lib/nokogiri/html4/document_fragment.rb:47:in `initialize'
        from /home/spin/src/github.com/Shopify/graal/sdk/mxbuild/linux-amd64/GRAALVM_4C1C657FB2_JAVA11/graalvm-4c1c657fb2-java11-22.3.0-dev/languages/ruby/lib/truffle/truffle/cext.rb:1241:in `rb_obj_call_init'
        from object.c:128:in `rb_obj_call_init'
        from /home/spin/.bundle/u2/gems/nokogiri-1.13.8/ext/nokogiri/xml_document_fragment.c:29:in `new'
        from /home/spin/src/github.com/Shopify/graal/sdk/mxbuild/linux-amd64/GRAALVM_4C1C657FB2_JAVA11/graalvm-4c1c657fb2-java11-22.3.0-dev/languages/ruby/lib/truffle/truffle/cext_ruby.rb:41:in `new'
        from /home/spin/.bundle/u2/gems/loofah-2.18.0/lib/loofah/html/document_fragment.rb:24:in `parse'
        from /home/spin/.bundle/u2/gems/loofah-2.18.0/lib/loofah.rb:42:in `fragment'
        from /home/spin/.bundle/u2/gems/rails-html-sanitizer-1.4.3/lib/rails/html/sanitizer.rb:121:in `sanitize'
        from /home/spin/.bundle/u2/gems/actionview-7.0.3.1/lib/action_view/helpers/sanitize_helper.rb:82:in `sanitize'
        from /home/spin/.bundle/u2/gems/actionview-7.0.3.1/lib/action_view/helpers/text_helper.rb:309:in `simple_format'
        <...>

nirvdrum avatar Sep 23 '22 14:09 nirvdrum