JDK-8220643 : [AOT] NullPointerException in org.graalvm.compiler.options.OptionKey$Lazy.
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 13
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2019-03-14
  • Updated: 2023-07-21
  • Resolved: 2023-07-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 13
13Resolved
Related Reports
Duplicate :  
Description
A lot of jck tests started to fail with

java.lang.ExceptionInInitializerError
	at jdk.internal.vm.compiler@13-internal/org.graalvm.compiler.options.OptionKey.checkDescriptorExists(OptionKey.java:64)
	at jdk.internal.vm.compiler@13-internal/org.graalvm.compiler.options.OptionKey.getValue(OptionKey.java:139)
	at jdk.internal.vm.compiler@13-internal/org.graalvm.compiler.hotspot.HotSpotGraalCompilerFactory.initializeGraalCompilePolicyFields(HotSpotGraalCompilerFactory.java:91)
	at jdk.internal.vm.compiler@13-internal/org.graalvm.compiler.hotspot.HotSpotGraalCompilerFactory.onSelection(HotSpotGraalCompilerFactory.java:76)
	at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJVMCICompilerConfig.getCompilerFactory(HotSpotJVMCICompilerConfig.java:106)
	at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.<init>(HotSpotJVMCIRuntime.java:296)
	at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJVMCIRuntime$DelayedInit.<clinit>(HotSpotJVMCIRuntime.java:79)
	at jdk.internal.vm.ci/jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime(HotSpotJVMCIRuntime.java:95)
	at jdk.internal.vm.ci/jdk.vm.ci.runtime.JVMCI.initializeRuntime(Native Method)
	at jdk.internal.vm.ci/jdk.vm.ci.runtime.JVMCI.<clinit>(JVMCI.java:58)
Caused by: java.lang.NullPointerException
	at jdk.internal.vm.compiler@13-internal/org.graalvm.compiler.options.OptionKey$Lazy.<clinit>(OptionKey.java:91)

when running with with AOTed jdk.internal.vm.compiler in Graal as JIT mode.

This issues started to occur after JDK-8218074 "Update Graal" was integrated.
Comments
The fix is upstream: https://github.com/oracle/graal/commit/2001d268271564cdcf1246ec70d4cb1b8bf13e91
21-03-2019

So, the issue seems to actually be with the HashTableSwitchOp that was added in December. The hash function computation seems to yield an incorrect value, leading to an incorrect offset into the jump table. The only explanation I have is that the java version of the hash function doesn't compute the same thing that the binary version computes.
19-03-2019

Narrowed it down to compilation of org.graalvm.compiler.java.BytecodeParserOptions_OptionDescriptors.get(Ljava/lang/String;)Lorg/graalvm/compiler/options/OptionDescriptor;
14-03-2019

Easier way to reproduce: #export JAVA_HOME=blah #cd jdk/open/test/hotspot/jtreg/compiler/aot/scripts #patch -p7 << end diff --git a/test/hotspot/jtreg/compiler/aot/scripts/build-jdk.vm-modules.sh b/test/hotspot/jtreg/compiler/aot/scripts/build-jdk.vm-modules.sh --- a/test/hotspot/jtreg/compiler/aot/scripts/build-jdk.vm-modules.sh +++ b/test/hotspot/jtreg/compiler/aot/scripts/build-jdk.vm-modules.sh @@ -37,7 +37,7 @@ $JAVA_HOME/bin/javac --add-modules jdk.internal.vm.ci --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=ALL-UNNAMED $DIR/$TEST.java # AOT compile non-tiered code version. -JAOTC_OPTS="-J-Xmx4g --info" +JAOTC_OPTS="-J-Xmx4g --info --compile-with-assertions" JAVA_OPTS="-Xmx4g -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseAOT -XX:+UnlockDiagnosticVMOptions -XX:+UseAOTStrictLoading --add-modules jdk.internal.vm.ci --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=ALL-UNNAMED" # Compile with: +UseCompressedOops +UseG1GC end #sh ./build-jdk.vm-modules.sh #$JAVA_HOME/bin/java -ea -esa -XX:+UseAOT -XX:+PrintAOT -XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler -XX:+BootstrapJVMCI
14-03-2019