Truffleruby: TypeError TruffleRuby doesn't have a case for the StringNodesFactory$MakeStringNodeGen node with values of type null

Created on 18 Jan 2021  路  3Comments  路  Source: oracle/truffleruby

Environment:

  • truffleruby 20.3.0, like ruby 2.6.6, GraalVM CE Native [x86_64-darwin]
  • Darwin COMP-C02DT18AML87 19.6.0 Darwin Kernel Version 19.6.0: Tue Nov 10 00:10:30 PST 2020; root:xnu-6153.141.10~1/RELEASE_X86_64 x86_64 i386 MacBookPro16,2 Darwin

Hey!

Just found this weird issue when trying to read the base_label of the backtrace locations of a reference processor thread. The issue doesn't seem to happen with regular threads.

TypeError (TruffleRuby doesn't have a case for the org.truffleruby.core.string.StringNodesFactory$MakeStringNodeGen node with values of type null org.jcodings.specific.UTF8Encoding org.truffleruby.core.rope.CodeRange)
    from org.truffleruby.core.string.StringNodesFactory$MakeStringNodeGen.executeAndSpecialize(StringNodesFactory.java:305)
    from org.truffleruby.core.string.StringNodesFactory$MakeStringNodeGen.executeMake(StringNodesFactory.java:220)
    from org.truffleruby.core.thread.ThreadBacktraceLocationNodes$BaseLabelNode.label(ThreadBacktraceLocationNodes.java:121)
    from org.truffleruby.core.thread.ThreadBacktraceLocationNodesFactory$BaseLabelNodeFactory$BaseLabelNodeGen.executeAndSpecialize(ThreadBacktraceLocationNodesFactory.java:419)
    from org.truffleruby.core.thread.ThreadBacktraceLocationNodesFactory$BaseLabelNodeFactory$BaseLabelNodeGen.execute(ThreadBacktraceLocationNodesFactory.java:404)
    from org.truffleruby.language.arguments.CheckArityNode.execute(CheckArityNode.java:41)
    from org.truffleruby.language.methods.ExceptionTranslatingNode.execute(ExceptionTranslatingNode.java:33)
    from org.truffleruby.language.RubyRootNode.execute(RubyRootNode.java:64)
    from org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:557)

I'm not sure what in my environment triggers the creation of a reference processor thread, but I did notice that irb also started one, so my minimal test case makes use of irb:

echo "puts Thread.list.find { |t| t.to_s =~ /reference-processor/ }.backtrace_locations.first.base_label" | irb

Let me know if I can provide any more info! :)
(For context, this was extracted from one of the tests on https://github.com/DataDog/dd-trace-rb)

bug

All 3 comments

Thanks for the report.
https://github.com/oracle/truffleruby/blob/f01379be2e700102436a5aaa52531fd03d02f970/src/main/java/org/truffleruby/core/thread/ThreadNodes.java#L195 passes the wrong value for currentNode (it passes the node of the current thread and not of the target thread), which causes this issue. I'll fix it.

Fixed in a5afb7a164e3318284e9c76d3448d3ab4baf1a7e.

That was FAST -- thanks!

Was this page helpful?
0 / 5 - 0 ratings