RFR: 8261455: Automatically generate the CDS archive if necessary [v2]
Ioi Lam
iklam at openjdk.java.net
Mon Jan 3 08:02:16 UTC 2022
On Tue, 28 Dec 2021 03:44:50 GMT, Yumin Qi <minqi at openjdk.org> wrote:
>> This patch is re-coded after serial fixes related: 8275846, 8276787, 8279018 etc.
>> original description(PR 5997):
>> `----------------------------------------------------------------------------------`
>> When shared archive (dynamic archive) failed to map due to damage of the archive file, dump/run jdk version mismatch or non-existence file etc, the new patch will automatically create a new shared archive if -XX:+AutoCreateSharedArchive specified with the name based on SharedArchiveFile.
>> This is a revised patch based on the old PR: 5077 and after bug 8273152 integrated.
>> `-----------------------------------------------------------------------------------`
>>
>> Tests: tier1,tier2,tier3,tier4
>>
>> Thanks
>> Yumin
>
> Yumin Qi has updated the pull request incrementally with one additional commit since the last revision:
>
> Set ArchiveClassesAtExit when AutoCreateSharedArchive is enabled
Another problem: VM crashes when the default base archive cannot be mapped:
$ ls -l /bld/fastdebug/images/jdk/lib/server/classes.jsa
-r--r--r-- 1 iklam dba 13815808 Jan 2 23:22 /bld/fastdebug/images/jdk/lib/server/classes.jsa
$ rm -f /bld/fastdebug/images/jdk/lib/server/classes.jsa
$ touch /bld/fastdebug/images/jdk/lib/server/classes.jsa
$ ls -l /bld/fastdebug/images/jdk/lib/server/classes.jsa
-rw-r--r-- 1 iklam dba 0 Jan 2 23:51 /bld/fastdebug/images/jdk/lib/server/classes.jsa
$ rm -f bar.jsa
$ /bld/fastdebug/images/jdk/bin/java -XX:+AutoCreateSharedArchive \
-XX:SharedArchiveFile=bar.jsa -cp HelloWorld.jar HelloWorld
# ...
# assert(ArchiveClassesAtExit != nullptr) failed: sanity
#
I am not sure if there's a good way of testing this inside jtreg. Maybe we can follow open/test/hotspot/jtreg/runtime/cds/appcds/MoveJDKTest.java and make a copy of the JDK and then corrupt its default base archive.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6920
More information about the hotspot-runtime-dev
mailing list