Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8278715 | 19 | Yumin Qi | P4 | Resolved | Fixed | b28 |
-Xshare:auto, which is the default, is supposed to use the specified archive if possible, but otherwise the VM should continue normal execution and ignore the specified archive(s).
However, in some cases, a bad archive would cause the VM to fail during start-up:
See attachments for bug.sh and log.txt
$ bash bug.sh $JAVA 2>&1 | cat > log.txt
$ cat log.txt
[....]
----------------------------------------------------------------------
Test case 2A: bad dynamic archive header, two archives
----------------------------------------------------------------------
+ /home/iklam/jdk/bld/nep/images/jdk/bin/java -Xshare:auto -Xlog:cds -cp HelloWorld.jar -XX:SharedArchiveFile=base.jsa:yyy.jsa HelloWorld
Error occurred during initialization of VM
Not a top shared archive: yyy.jsa
=====================================
Proposed new behavior:
-XX:SharedArchiveFile=foo.jsa
-> if foo.jsa cannot be loaded, continue execution with CDS disabled
-XX:SharedArchiveFile=base.jsa:top.jsa
-> if top.jsa cannot be loaded, or does not match base.jsa
-> if base.jsa cannot be loaded, continue execution with CDS disabled
-> if base.jsa can be loaded, continue execution with only base.jsa loaded
continue execution with CDS disabled
However, in some cases, a bad archive would cause the VM to fail during start-up:
See attachments for bug.sh and log.txt
$ bash bug.sh $JAVA 2>&1 | cat > log.txt
$ cat log.txt
[....]
----------------------------------------------------------------------
Test case 2A: bad dynamic archive header, two archives
----------------------------------------------------------------------
+ /home/iklam/jdk/bld/nep/images/jdk/bin/java -Xshare:auto -Xlog:cds -cp HelloWorld.jar -XX:SharedArchiveFile=base.jsa:yyy.jsa HelloWorld
Error occurred during initialization of VM
Not a top shared archive: yyy.jsa
=====================================
Proposed new behavior:
-XX:SharedArchiveFile=foo.jsa
-> if foo.jsa cannot be loaded, continue execution with CDS disabled
-XX:SharedArchiveFile=base.jsa:top.jsa
-> if top.jsa cannot be loaded, or does not match base.jsa
-> if base.jsa cannot be loaded, continue execution with CDS disabled
-> if base.jsa can be loaded, continue execution with only base.jsa loaded
continue execution with CDS disabled
- backported by
-
JDK-8278715 -Xshare:auto should tolerate problems in the CDS archive
- Resolved
- relates to
-
JDK-8276787 Improve warning messages for -XX:+RecordDynamicDumpInfo
- Resolved
-
JDK-8275846 read_base_archive_name() could read past the end of buffer
- Resolved