RFR: 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:58 UTC 2025
On Tue, 18 Nov 2025 07:44:39 GMT, Aleksey Shipilev <shade 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).
>
> Marked as reviewed by shade (Reviewer).
Thanks @shipilev @mgronlun for the review
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28365#issuecomment-3548946436
More information about the hotspot-dev
mailing list