JDK-8245283 : JFR: Can't handle constant dynamic used by Jacoco agent
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jfr
  • Affected Version: 11,14.0.1
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: os_x_10.15
  • CPU: x86
  • Submitted: 2020-05-19
  • Updated: 2021-04-01
  • Resolved: 2020-06-03
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
Related Reports
Duplicate :  
Relates :  
The issue seems to be related to issue JDK-8232997 which should be fixed on JDK-14. But this one can be still reproduced on JDK-14.

Current thread (0x00007fd574009000):  JavaThread "main" [_thread_in_vm, id=6147, stack(0x000070000cc16000,0x000070000cd16000)]

Stack: [0x000070000cc16000,0x000070000cd16000],  sp=0x000070000cd13180,  free space=1012k
Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libsystem_platform.dylib+0xaf0]  _platform_memmove$VARIANT$Haswell+0x1f0
V  [libjvm.dylib+0x3608f0]  JfrEventClassTransformer::on_klass_creation(InstanceKlass*&, ClassFileParser&, Thread*)+0xdac
V  [libjvm.dylib+0x4cb343]  KlassFactory::create_from_stream(ClassFileStream*, Symbol*, ClassLoaderData*, Handle, InstanceKlass const*, GrowableArray<Handle>*, Thread*)+0x1a9
V  [libjvm.dylib+0x6b79bc]  SystemDictionary::resolve_from_stream(Symbol*, Handle, Handle, ClassFileStream*, Thread*)+0x112
V  [libjvm.dylib+0x3c61c8]  jvm_define_class_common(JNIEnv_*, char const*, _jobject*, signed char const*, int, _jobject*, char const*, Thread*)+0x25a
V  [libjvm.dylib+0x3c630b]  JVM_DefineClassWithSource+0xc1
C  [libjava.dylib+0x1814]  Java_java_lang_ClassLoader_defineClass1+0x164
j  java.lang.ClassLoader.defineClass1(Ljava/lang/ClassLoader;Ljava/lang/String;[BIILjava/security/ProtectionDomain;Ljava/lang/String;)Ljava/lang/Class;+0 java.base@14.0.1
j  java.lang.ClassLoader.defineClass(Ljava/lang/String;[BIILjava/security/ProtectionDomain;)Ljava/lang/Class;+27 java.base@14.0.1
Fix request (13u) Requesting backport to 13u for parity with 11u. The patch applies cleanly. Tested with tier1 and jdk/jfr tests.

[11u] Fix Request Please, consider approving this fix for backporting to JDK 11u. The fix prevents JVM crashes when JFR is retransforming classes with constant dynamics. The patch applies cleanly and tier1 and jdk_jfr tests are passing.

Thanks for the fix! Is there any chance to have the fix back ported into the JDK-11?

Verified using attached reproducer on JDK 15 ea build 27.

URL: https://hg.openjdk.java.net/jdk/jdk/rev/839d49bd8d8d User: egahlin Date: 2020-06-03 22:13:03 +0000

ILW = HMM = P2

Added a test project. Steps to reproduce: > tar xzf testproject.tgz > cd TestProject > mvn test