JDK-8340826 : Should not send unload notification for scratch classes
  • Type: Bug
  • Component: hotspot
  • Sub-Component: jvmti
  • Affected Version: 24
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-09-24
  • Updated: 2024-10-07
  • Resolved: 2024-09-27
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 24
24 b18Fixed
Related Reports
Relates :  
Relates :  
Description
The jvmti class redefinition creates temporary scratch classes for it's own purposes. These classes are added to corresponding classloaders and might be unloaded. 
In this case the jvmti/jfr and log events are generated twice: for original class and for it's scratch.

The bug could be reproduced by jfr test
jdk/jfr/api/metadata/eventtype/TestUnloadingEventClass.java 
with '-Xcomp  -XX:TieredStopAtLevel=1' or with '-Xcomp'

The test hang because got 2 events while waiting for one.

Comments
Changeset: 12de4fbc Branch: master Author: Leonid Mesnik <lmesnik@openjdk.org> Date: 2024-09-27 15:02:01 +0000 URL: https://git.openjdk.org/jdk/commit/12de4fbce7a314a1c5c84340526cd65b9a4a29d1
27-09-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/21166 Date: 2024-09-24 16:29:36 +0000
24-09-2024