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

-Xshare:auto should tolerate problems in the CDS archive

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 18
    • 18
    • hotspot
    • 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. bug.sh
            3 kB
            Ioi Lam
          2. log.txt
            7 kB
            Ioi Lam

          Issue Links

            Activity

              People

                minqi Yumin Qi
                iklam Ioi Lam
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: