JDK-8262097 : Improve CompilerConfig ergonomics to fix a VM crash after JDK-8261229
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-02-21
  • Updated: 2021-03-02
  • Resolved: 2021-02-22
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 17
17 b11Fixed
Related Reports
Relates :  
Description
* Reproduce

1. Build JVM without C2: bash configure --with-jvm-features=-compiler2; make images
2. java -XX:-TieredCompilation -version


* Symptom
```
   #
   # A fatal error has been detected by the Java Runtime Environment:
   #
   #  Internal Error (/home/jvm/jdk/src/hotspot/share/compiler/compileBroker.cpp:1360), pid=22265, tid=22266
   #  assert(comp != __null) failed: Ensure we have a compiler
   #
  

   Current thread (0x00007f6fa4024640):  JavaThread "main" [_thread_in_vm, id=22266, stack(0x00007f6fabc7e000,0x00007f6fabd7f000)]
  
   Stack: [0x00007f6fabc7e000,0x00007f6fabd7f000],  sp=0x00007f6fabd7a720,  free space=1009k
   Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
   V  [libjvm.so+0x44fb14]  CompileBroker::compile_method(methodHandle const&, int, int, methodHandle const&, int, CompileTask::CompileReason, Thread*)+0xc4
   V  [libjvm.so+0x4409eb]  CompilationPolicy::compile(methodHandle const&, int, CompLevel, Thread*)+0x18b
   V  [libjvm.so+0x442fde]  CompilationPolicy::event(methodHandle const&, methodHandle const&, int, int, CompLevel, CompiledMethod*, Thread*)+0x3ce
   V  [libjvm.so+0x315bbb]  Runtime1::counter_overflow(JavaThread*, int, Method*)+0x20b
   v  ~RuntimeStub::counter_overflow Runtime1 stub
   J 2 c1 java.lang.Object.<init>()V java.base (1 bytes) @ 0x00007f6f995eb803 [0x00007f6f995eb780+0x0000000000000083]
   j  java.util.HashMap$Node.<init>(ILjava/lang/Object;Ljava/lang/Object;Ljava/util/HashMap$Node;)V+1 java.base
   j  java.util.HashMap.newNode(ILjava/lang/Object;Ljava/lang/Object;Ljava/util/HashMap$Node;)Ljava/util/HashMap$Node;+9 java.base
   j  java.util.HashMap.putVal(ILjava/lang/Object;Ljava/lang/Object;ZZ)Ljava/lang/Object;+56 java.base
   j  java.util.HashMap.put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;+9 java.base
   j  jdk.internal.module.ModuleHashes$Builder.hashForModule(Ljava/lang/String;[B)Ljdk/internal/module/ModuleHashes$Builder;+6 java.base
   j  jdk.internal.module.SystemModules$default.moduleHashes()[Ljdk/internal/module/ModuleHashes;+7918 java.base
   j  jdk.internal.module.SystemModuleFinders.of(Ljdk/internal/module/SystemModules;)Ljava/lang/module/ModuleFinder;+15 java.base
   j  jdk.internal.module.ModuleBootstrap.boot2()Ljava/lang/ModuleLayer;+252 java.base
   j  jdk.internal.module.ModuleBootstrap.boot()Ljava/lang/ModuleLayer;+64 java.base
   j  java.lang.System.initPhase2(ZZ)I+0 java.base
   v  ~StubRoutines::call_stub
   V  [libjvm.so+0x743c7f]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x57f
   V  [libjvm.so+0x745bbc]  JavaCalls::call_static(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, Thread*)+0x19c
   V  [libjvm.so+0xf885e5]  Threads::create_vm(JavaVMInitArgs*, bool*)+0x775
   V  [libjvm.so+0x876749]  JNI_CreateJavaVM+0x99
   C  [libjli.so+0x3e1a]  JavaMain+0x8a
   C  [libjli.so+0x7769]  ThreadJavaMain+0x9
```
Comments
Changeset: f2bde05e Author: Jie Fu <jiefu@openjdk.org> Date: 2021-02-22 23:43:28 +0000 URL: https://git.openjdk.java.net/jdk/commit/f2bde05e
22-02-2021