Integrated: 8314846: Do not store Klass::_secondary_super_cache in CDS archive

Ioi Lam iklam at openjdk.org
Mon Apr 22 15:55:33 UTC 2024


On Thu, 18 Apr 2024 22:19:31 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> This bug was found during Leyden development.
> 
> CDS's `ArchiveBuilder` expects the class metadata to stop mutating while we're inside the CDS dumping safepoint. However, `Klass::_secondary_super_cache` can be updated as a side effect of `Klass::is_subtype_of()`.
> 
> Currently, we don't call `Klass::is_subtype_of()`inside the CDS safepoint. However, it's likely that future optimizations will make such calls (as being done in the Leyden prototype). When that happens, the CDS dump will fail with a hard-to-debug failure (some class is found inside `_secondary_super_cache` that `ArchiveBuilder` doesn't know about.
> 
> There's no benefit in storing `Klass::_secondary_super_cache` in the CDS archive. So the safest thing to do is to stop scanning it during CDS dumping, and clear it to `nullptr` when the `Klass` is stored in the CDS archive.

This pull request has now been integrated.

Changeset: 20be5e09
Author:    Ioi Lam <iklam at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/20be5e095f85d92215df68bb6eeb621b4ed249a1
Stats:     6 lines in 1 file changed: 5 ins; 1 del; 0 mod

8314846: Do not store Klass::_secondary_super_cache in CDS archive

Reviewed-by: stuefe, aph

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

PR: https://git.openjdk.org/jdk/pull/18848


More information about the hotspot-dev mailing list