RFR: 8352092: -XX:AOTMode=record crashes with InstanceKlass in allocated state

Ioi Lam iklam at openjdk.org
Mon Mar 24 07:08:17 UTC 2025


On Mon, 24 Mar 2025 06:50:54 GMT, David Holmes <dholmes at openjdk.org> wrote:

> I can't convince myself this is the right place to fix this.
> 
> If we attempt to use `DefineClass` for a class in an illegal package, it will fail won't it? In which case how do we end up with any `instanceKlass` object to archive? Shouldn't it be deleted, assuming it ever got created? And if it was created do we really want to archive classes that are not even loaded?

The affected code in this PR is not choosing what classes to be archived. Instead, it's just going through all live classes and tries to eagerly link them.

Classes that are not in the `loaded` state are filtered out from the archive by this code:

https://github.com/openjdk/jdk/blob/adfb1206498987f43a4cf0cd6ba0cb6a5bb8e479/src/hotspot/share/classfile/systemDictionaryShared.cpp#L289-L291

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

PR Comment: https://git.openjdk.org/jdk/pull/24172#issuecomment-2747085114


More information about the hotspot-runtime-dev mailing list