Integrated: 8372045: AOT assembly phase asserts with old class if AOT class linking is disabled
Ioi Lam
iklam at openjdk.org
Tue Nov 18 18:15:59 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).
This pull request has now been integrated.
Changeset: b3e408c0
Author: Ioi Lam <iklam at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/b3e408c07891b58a312a58ffd756d6a1d18c0f6d
Stats: 105 lines in 2 files changed: 104 ins; 0 del; 1 mod
8372045: AOT assembly phase asserts with old class if AOT class linking is disabled
Reviewed-by: shade, mgronlun
-------------
PR: https://git.openjdk.org/jdk/pull/28365
More information about the hotspot-dev
mailing list