JDK-8250233 : -XX:+CITime triggers guarantee(events != NULL) in jvmci.cpp:173
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11.0.9-oracle,16
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2020-07-23
  • Updated: 2021-01-04
  • Resolved: 2020-08-04
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 11 JDK 16
11.0.10-oracleFixed 16 b09Fixed
Related Reports
Relates :  
Description
Here is the call stack: 

Stack: [0x0000700006a8e000,0x0000700006b8e000],  sp=0x0000700006b8d7d0,  free space=1021k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.dylib+0xa6cb7c]  VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x68c
V  [libjvm.dylib+0xa6d23b]  VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, __va_list_tag*)+0x3b
V  [libjvm.dylib+0x2f3e3a]  report_vm_error(char const*, int, char const*, char const*, ...)+0xaa
V  [libjvm.dylib+0x5754b6]  JVMCI::vlog(int, char const*, __va_list_tag*)+0xa6
V  [libjvm.dylib+0x574eb0]  JVMCI::event1(char const*, ...)+0xb0
V  [libjvm.dylib+0x57be00]  JVMCICompiler::print_compilation_timers()+0x30
V  [libjvm.dylib+0x2cf643]  CompileBroker::print_times(bool, bool)+0x383
V  [libjvm.dylib+0x4a6da2]  print_statistics()+0x32
V  [libjvm.dylib+0x4a7186]  before_exit(JavaThread*)+0x2e6
V  [libjvm.dylib+0xa0c423]  Threads::destroy_vm()+0xc3
V  [libjvm.dylib+0x51ffd5]  jni_DestroyJavaVM+0xa5
C  [libjli.dylib+0x4fd6]  JavaMain+0xc36
C  [libjli.dylib+0x75e9]  ThreadJavaMain+0x9
C  [libsystem_pthread.dylib+0x6109]  _pthread_start+0x94
C  [libsystem_pthread.dylib+0x1b8b]  thread_start+0xf

I have the suspicion the real culprit is in CompileBroker.cpp:

void CompileBroker::print_times(bool per_compiler, bool aggregate) {
#if INCLUDE_JVMCI
<...>
  // In hosted mode, print the JVMCI compiler specific counters manually.
  if (!UseJVMCICompiler) {
    JVMCICompiler::print_compilation_timers();
  }
#else // INCLUDE_JVMCI
<...>
Comments
As Christian pointed the bug is not triggered with JDK15. I tested with latest 15.0.2-ea+2-11 and it passed too. I removed 15 from affected version.
14-10-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/d4c397adee35 User: kvn Date: 2020-08-04 20:16:54 +0000
04-08-2020

https://cr.openjdk.java.net/~kvn/8250233/webrev.00/
31-07-2020

RFR discussion reveals the fix suggested above is incorrect. The real issue is missing EnableJVMCI flag checks.
28-07-2020

Yes, thg history says it has all been introduced with the JVMCI JEP (JDK-8136421).
27-07-2020

Yes, the now failing guarantee() was introduced with JDK-8248321, but the bad if statement has been in there quite a while longer. Couldn't find the change yet.
24-07-2020

ILW = Guarantee failure during JIT compilation, with debug flag, no workaround (but disable flag) = HLM = P3
24-07-2020

Looks like this has been introduced by JDK-8248321.
24-07-2020

additional comment: An easy and obvious fix would be to change the suspicions if into if (UseJVMCICompiler) { JVMCICompiler::print_compilation_timers(); } I'm not sure if that would have adverse effects on the case when UseJVMCICompiler is true.
23-07-2020