RFR: 8261455: Automatically generate the CDS archive if necessary [v2]
Yumin Qi
minqi at openjdk.java.net
Thu Jan 13 00:25:37 UTC 2022
On Mon, 3 Jan 2022 07:59:29 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> 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.
@iklam @calvinccheung
Thanks for review!
-------------
PR: https://git.openjdk.java.net/jdk/pull/6920
More information about the hotspot-runtime-dev
mailing list