Closed
Description
The src/java.base/share/classes/java/lang/Throwable.java
class was patched in OpenJDK tip, due to this issue and associated PR, and now the jfrTracing
field is not volatile anymore. However, jdk.graal.compiler.truffle.KnownTruffleTypes::getThrowableJFRTracingField
assumes that the field is volatile. Because of this incompatibility Truffle crashes with this error:
Caused by: jdk.graal.compiler.debug.GraalError: should not reach here: Field Throwable.jfrTracing not found. This field was added in JDK-22+24 and must be present. This either means this field was removed in which case this code needs to be adapted or the meta access lookup above failed which should never happen.
at jdk.graal.compiler/jdk.graal.compiler.debug.GraalError.shouldNotReachHere(GraalError.java:59)
at jdk.graal.compiler/jdk.graal.compiler.truffle.KnownTruffleTypes.getThrowableJFRTracingField(KnownTruffleTypes.java:228)
at jdk.graal.compiler/jdk.graal.compiler.truffle.KnownTruffleTypes.<init>(KnownTruffleTypes.java:217)
at jdk.graal.compiler/jdk.graal.compiler.truffle.hotspot.HotSpotKnownTruffleTypes.<init>(HotSpotKnownTruffleTypes.java:60)
at jdk.graal.compiler/jdk.graal.compiler.truffle.hotspot.HotSpotTruffleCompilerImpl.create(HotSpotTruffleCompilerImpl.java:159)
at jdk.graal.compiler/jdk.graal.compiler.truffle.hotspot.HotSpotTruffleCompilationSupport.createCompiler(HotSpotTruffleCompilationSupport.java:71)
at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.OptimizedTruffleRuntime.newTruffleCompiler(OptimizedTruffleRuntime.java:313)
at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.hotspot.HotSpotTruffleRuntime.initializeTruffleCompiler(HotSpotTruffleRuntime.java:287)
at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.hotspot.HotSpotTruffleRuntime$1.accept(HotSpotTruffleRuntime.java:247)
at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.hotspot.HotSpotTruffleRuntime$1.accept(HotSpotTruffleRuntime.java:243)
at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.CompilationTask.call(CompilationTask.java:245)
at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.CompilationTask.call(CompilationTask.java:57)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
at java.base/java.lang.Thread.run(Thread.java:1474)
at org.graalvm.truffle.runtime/com.oracle.truffle.runtime.BackgroundCompileQueue$TruffleCompilerThreadFactory$1.run(BackgroundCompileQueue.java:304)
Internal GraalVM error, please report at https://github.com/oracle/graal/issues/.
The fix seems to be simply to not require the field to be volatile if JDK is > 25.