RFR: 8372045: AOT assembly phase asserts with old class if AOT class linking is disabled

Aleksey Shipilev shade at openjdk.org
Tue Nov 18 07:47:09 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).

Marked as reviewed by shade (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/28365#pullrequestreview-3475947563


More information about the hotspot-dev mailing list