RFR: 8366420: AOTMapTest fails when jsa is missing
Ioi Lam
iklam at openjdk.org
Mon Sep 1 07:44:41 UTC 2025
On Fri, 29 Aug 2025 07:58:29 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
> We fail in one of our test setups with this output :
> runtime/cds/appcds/aotCache/AOTMapTest_dynamic
>
>
> stdout: [[0.003s][error][cds] An error has occurred while processing the shared archive file. Run with -Xlog:aot,cds for details.
> [0.003s][error][cds] Specified shared archive file not found (AOTMapTestApp.dynamic.jsa)
> [0.003s][error][cds] Not a valid shared archive file (AOTMapTestApp.dynamic.jsa)
> [0.003s][error][cds] CDS is incompatible with other specified options.
> Error occurred during initialization of VM
> Unable to use shared archive: invalid archive
> ];
> stderr: []
> exitValue = 1
>
> java.lang.RuntimeException: Expected to get exit value of [0], exit value is: [1]
> at jdk.test.lib.process.OutputAnalyzer.shouldHaveExitValue(OutputAnalyzer.java:522)
> at jdk.test.lib.cds.CDSAppTester.executeAndCheck(CDSAppTester.java:217)
> at jdk.test.lib.cds.CDSAppTester.productionRun(CDSAppTester.java:426)
> at jdk.test.lib.cds.CDSAppTester.productionRun(CDSAppTester.java:393)
> at jdk.test.lib.cds.CDSAppTester.runDynamicWorkflow(CDSAppTester.java:464)
> at jdk.test.lib.cds.CDSAppTester.run(CDSAppTester.java:445)
> at AOTMapTest.doTest(AOTMapTest.java:71)
> at AOTMapTest.main(AOTMapTest.java:61)
> at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
> at java.base/java.lang.reflect.Method.invoke(Method.java:565)
> at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
> at java.base/java.lang.Thread.run(Thread.java:1474)
>
>
> This test setup is a bit special because it contains only one jsa cds archive (the one for compressed object headers). So the 'classes.jsa' is missing .
Actually, I think it's better to remove the logic of explicitly setting `-XX:[+-]UseCompressedOops` in this test case. I.e., remove the `compressed` parameter to the `AOTMapTest.doTest()` function.
Instead, we should rely on tier testing for VM flag rotation. For example, in our CI, we have one test task that runs all tests with `-vmoptions:-XX:-UseCompressedOops`.
----
With the current fix, I think the test will fail if you run it with `-vmoptions:-XX:-UseCompressedOops` using your JDK:
- `vm.cds.default.archive.available` will report false (because your JDK doesn't have a classes_nocoops.jsa file)
- CDSAppTester will generate a temp-base JSA file to run the first scenario (-UseCompressedOops). This scenario will pass.
- CDSAppTester will then use the same temp-base JSA file to run the second scenario (+UseCompressedOops). This scenario will fail.
- `-vmoptions:-XX:-UseCompressedOops`
-------------
Changes requested by iklam (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/27001#pullrequestreview-3172470614
More information about the hotspot-runtime-dev
mailing list