RFR: 8372045: AOT assembly phase asserts with old class if AOT class linking is disabled
Markus Grönlund
mgronlun at openjdk.org
Tue Nov 18 14:31:34 UTC 2025
On Tue, 18 Nov 2025 05:05:09 GMT, Ioi Lam <iklam at openjdk.org> wrote:
> Old classes should be stored in the AOT cache only if `CDSConfig::is_preserving_verification_constraints() == true`. However, we miss this check in the AOT assembly phase: the `this` class is loaded from the AOT configuration file, which is a special type of AOT cache, so `AOTMetaspace::in_aot_cache(this)` returns true:
>
>
> bool InstanceKlass::can_be_verified_at_dumptime() const {
> if (AOTMetaspace::in_aot_cache(this)) {
> // This is a class that was dumped into the base archive, so we know
> // it was verified at dump time.
> return true;
> }
>
>
> The fix is
>
> ```
> bool InstanceKlass::can_be_verified_at_dumptime() const {
> if (CDSConfig::is_dumping_dynamic_archive() && AOTMetaspace::in_aot_cache(this)) {
>
>
> as this check is intended to be used only when dumping the dynamic archive.
>
> This bug was found when running a complex application (specJBB) but I created a simple reproducer (OldClassSupport2.java).
Thanks for fixing this, Ioi.
-------------
Marked as reviewed by mgronlun (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/28365#pullrequestreview-3478108336
More information about the hotspot-dev
mailing list