Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8276769

-Xshare:auto should tolerate problems in the CDS archive

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 18
    • Fix Version/s: 18
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b28

      Backports

        Description

        -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




          Attachments

          1. log.txt
            7 kB
          2. bug.sh
            3 kB

            Issue Links

              Activity

                People

                Assignee:
                minqi Yumin Qi (Inactive)
                Reporter:
                iklam Ioi Lam
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: