RFR: 8341452: Test runtime/cds/appcds/DumpRuntimeClassesTest.java from JDK-8324259 is failing

David Holmes dholmes at openjdk.org
Fri Oct 4 02:21:34 UTC 2024


On Thu, 3 Oct 2024 17:43:50 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:

> DumpRuntimeClassesTest.java was added in [JDK-8324259](https://bugs.openjdk.org/browse/JDK-8324259) to verify that the newly added dummy call archived classes that are used at CDS runtime. This new test exposed a case where `JarVerifier` is used at CDS runtime while not being in the archive, so this patch performs a dummy call to `JarVerifier`. 
> 
> When using `-Xcomp`, the class `Manifest` is compiled which causes `JarVerifier` to be loaded. This does not occur in other modes since the constructor of `Manifest` doesn't create any instances of `JarVerifier`. The existing dummy call to `Manifest` doesn't load `JarVerifier` either, so a separate dummy call can be used to ensure it is loaded at dumptime. Now that there are multiple dummy calls, they are pulled out into a new method `make_dummy_calls()`. Verified with tier x-y tests.

Apologies for leaving review comments immediately before disappearing on vacation. No need to wait for me to return and respond.

P.S you also need to unProblemList the test.

src/hotspot/share/cds/metaspaceShared.cpp line 757:

> 755:   // Some classes are used at CDS runtime but are not loaded, and therefore archived, at
> 756:   // dumptime. We can perform dummmy calls to these classes at dumptime to ensure they
> 757:   // are archived.

This code doesn't just load classes though, it loads, links, initializes them and creates a unwanted instance. Isn't there a simpler way to do this? Do these classes have to be initialized?

src/hotspot/share/cds/metaspaceShared.cpp line 764:

> 762: 
> 763: void MetaspaceShared::make_dummy_calls(TRAPS) {
> 764:   // Exercise the manifest processing code

Nit: can we think of a better name rather than "dummy"?

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

PR Review: https://git.openjdk.org/jdk/pull/21329#pullrequestreview-2346963837
PR Comment: https://git.openjdk.org/jdk/pull/21329#issuecomment-2392660124
PR Review Comment: https://git.openjdk.org/jdk/pull/21329#discussion_r1787029188
PR Review Comment: https://git.openjdk.org/jdk/pull/21329#discussion_r1787029620


More information about the hotspot-dev mailing list