JDK-8213172 : CDS and JFR tests fail with assert(JdkJfrEvent::is(klass)) failed: invariant
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jfr
  • Affected Version: 12
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-10-31
  • Updated: 2019-06-13
  • Resolved: 2018-10-31
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 12
11.0.5-oracleFixed 12 b18Fixed
Related Reports
Relates :  
Description
In CI tier 2 and 3 testing on all platforms:

#  assert(JdkJfrEvent::is(klass)) failed: invariant

Current thread (0x00007f10b001a800):  JavaThread "main" [_thread_in_vm, id=15523, stack(0x00007f10bb06c000,0x00007f10bb16d000)]

Stack: [0x00007f10bb06c000,0x00007f10bb16d000],  sp=0x00007f10bb16a940,  free space=1018k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x1864073]  VMError::report_and_die(int, char const*, char const*, __va_list_tag*, Thread*, unsigned char*, void*, void*, char const*, int, unsigned long)+0x2c3
V  [libjvm.so+0x1864e8f]  VMError::report_and_die(Thread*, void*, char const*, int, char const*, char const*, __va_list_tag*)+0x2f
V  [libjvm.so+0xb12860]  report_vm_error(char const*, int, char const*, char const*, ...)+0x100
V  [libjvm.so+0xed54db]  JfrEventClasses::get_all_event_classes(Thread*)+0x78b
V  [libjvm.so+0xee8e51]  jfr_get_all_event_classes+0x141
j  jdk.jfr.internal.JVM.getAllEventClasses()Ljava/util/List;+0 jdk.jfr@12-internal
j  jdk.jfr.internal.MetadataRepository.unregisterUnloaded()V+24 jdk.jfr@12-internal
j  jdk.jfr.internal.MetadataRepository.setOutput(Ljava/lang/String;)V+8 jdk.jfr@12-internal
j  jdk.jfr.internal.PlatformRecorder.start(Ljdk/jfr/internal/PlatformRecording;)V+135 jdk.jfr@12-internal
j  jdk.jfr.internal.PlatformRecording.start()V+65 jdk.jfr@12-internal
j  jdk.jfr.Recording.start()V+4 jdk.jfr@12-internal
j  jdk.jfr.internal.dcmd.DCmdStart.execute(Ljava/lang/String;[Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Boolean;Ljava/lang/Boolean;)Ljava/lang/String;+701 jdk.jfr@12-internal
v  ~StubRoutines::call_stub
V  [libjvm.so+0xe8befa]  JavaCalls::call_helper(JavaValue*, methodHandle const&, JavaCallArguments*, Thread*)+0x85a
V  [libjvm.so+0xe8777a]  JavaCalls::call_virtual(JavaValue*, Klass*, Symbol*, Symbol*, JavaCallArguments*, Thread*)+0x31a
V  [libjvm.so+0xedb9a0]  JfrJavaCall::call_virtual(JfrJavaArguments*, Thread*)+0x300
V  [libjvm.so+0xec420d]  JfrStartFlightRecordingDCmd::execute(DCmdSource, Thread*)+0xb9d
V  [libjvm.so+0xf155c3]  JfrRecorder::on_vm_start()+0x4f3
V  [libjvm.so+0xeb1229]  Jfr::on_vm_start()+0x9
V  [libjvm.so+0x1798b3a]  Threads::create_vm(JavaVMInitArgs*, bool*)+0x77a
V  [libjvm.so+0xfac4ea]  JNI_CreateJavaVM+0x6a
C  [libjli.so+0x3fe6]  JavaMain+0x86

Seems to have been caused by JDK-8203629
Comments
Fix request: This fix is part of a series of JFR patches that Oracle have integrated into their 11.0.5 update. The series consists of JDK-8203629, JDK-8213172, JDK-8214161 and JDK-8148188. They all apply (in that order, with a little fuzz for JDK-8148188 in src/java.base/share/classes/java/security/Security.java) and tests at the SAP test system show no regressions. So requesting backport approval for 11u.
08-06-2019

Seems this fix is needed: diff -r 385609cec1f8 src/hotspot/share/classfile/dictionary.cpp --- a/src/hotspot/share/classfile/dictionary.cpp Wed Oct 31 05:26:07 2018 +0100 +++ b/src/hotspot/share/classfile/dictionary.cpp Wed Oct 31 06:05:04 2018 +0100 @@ -468,7 +468,7 @@ #if INCLUDE_CDS static bool is_jfr_event_class(Klass *k) { while (k) { - if (k->name()->equals("jdk/jfr/Event")) { + if (k->name()->equals("jdk/internal/event/Event")) { return true; } k = k->super();
31-10-2018