RFR: 8377665: JFR: Symbol table not setup for early class unloading

Markus Grönlund mgronlun at openjdk.org
Wed Feb 11 20:16:49 UTC 2026


On Wed, 11 Feb 2026 12:31:24 GMT, Joel Sikström <jsikstro at openjdk.org> wrote:

> Hello,
> 
> We observe a crash when running a major GC very early, which unloads classes, calling into JFR which is not properly set up for class unloading this early. A simple fix for this is to move the creation of the symbol table to the early setup of JFR, which allows us to successfully call `JfrCheckpointManager::on_unloading_classes()`.
> 
> Testing:
>  * Crash reproducer no longer crashes
>  * Running through Oracle's tier1-4

Please see the comment about _initial_type_set state.

Looks good, Joel. Thanks for finding and fixing this.

I stepped it through and found a minor bug we should fix (related to unloading). Can you also please add:


diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp
index b1c502e17f8..3dd9ea41d3d 100644
--- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp
+++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeSet.cpp
@@ -1265,7 +1265,7 @@ static size_t teardown() {
     JfrKlassUnloading::clear();
     _artifacts->clear();
     _initial_type_set = true;
-  } else {
+  } else if (is_initial_typeset_for_chunk()) {
     _initial_type_set = false;
   }


Else unloading() will modify the _initial_type_set flag, which we don't want.

Thanks
Markus

-------------

Changes requested by mgronlun (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/29672#pullrequestreview-3787174383
PR Comment: https://git.openjdk.org/jdk/pull/29672#issuecomment-3886872090


More information about the hotspot-jfr-dev mailing list