RFR: 8344822: CDS BulkLoaderTest.java#dynamic fails with COH
Ioi Lam
iklam at openjdk.org
Wed Nov 27 06:51:38 UTC 2024
On Wed, 27 Nov 2024 05:27:55 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Creating a dynamic CDS archive (with `-XX:ArchiveClassesAtExit=<foo>.jsa`) requires that the current JVM process is using a static archive (which is usually the default CDS archive included in the JDK). The tests fails because the JVM is executed with `-XX:+UseCompactObjectHeaders`, but the JDK doesn't include a default CDS archive that's compatible with such VM options.
>>
>> The fix is to detect for this situation, and create a temporary static archive to be used by the test.
>>
>> Unfortunately this detection requires WhiteBox, so all test cases that use `CDSAppTester` with `@run ... DYNAMIC` need to be modified to add the appropriate jtreg tags.
>
> test/lib/jdk/test/lib/cds/CDSAppTester.java line 215:
>
>> 213: opts.setArchiveName(tempBaseArchiveFile);
>> 214: opts.addSuffix("-Djava.class.path=");
>> 215: OutputAnalyzer out = CDSTestUtils.createArchive(opts);
>
> Just to be clear, this creates the right kind of archive based on whether +UCOH is used or not?
Yes, `CDSTestUtils.createArchive()` uses `ProcessTools.createTestJavaProcessBuilder()` to launch a child process to create the archive, so it passes the test vm options to the child.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22403#discussion_r1860029167
More information about the hotspot-runtime-dev
mailing list