8023381: VM fails to initialize in runtime/CDSCompressedKPtrs/XShareAuto.java runtime/SharedArchiveFile/CdsSameObjectAlignment.java
authorhseigel
Sun, 01 Sep 2013 10:37:01 -0400
changeset 19707 fecaabc8e462
parent 19706 e552fd61a349
child 19725 68b03cf81206
child 19951 cece69b005c0
8023381: VM fails to initialize in runtime/CDSCompressedKPtrs/XShareAuto.java runtime/SharedArchiveFile/CdsSameObjectAlignment.java Summary: Improve handling when CDS archive cannot be mapped Reviewed-by: kvn, dholmes, mseledtsov
hotspot/src/share/vm/memory/filemap.cpp
hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java
hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java
hotspot/test/runtime/SharedArchiveFile/CdsSameObjectAlignment.java
--- a/hotspot/src/share/vm/memory/filemap.cpp	Fri Aug 30 15:42:01 2013 -0700
+++ b/hotspot/src/share/vm/memory/filemap.cpp	Sun Sep 01 10:37:01 2013 -0400
@@ -55,6 +55,7 @@
               " shared archive file.\n");
   jio_vfprintf(defaultStream::error_stream(), msg, ap);
   jio_fprintf(defaultStream::error_stream(), "\n");
+  // Do not change the text of the below message because some tests check for it.
   vm_exit_during_initialization("Unable to use shared archive.", NULL);
 }
 
--- a/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java	Fri Aug 30 15:42:01 2013 -0700
+++ b/hotspot/test/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java	Sun Sep 01 10:37:01 2013 -0400
@@ -51,9 +51,8 @@
         output.shouldHaveExitValue(0);
 
       } catch (RuntimeException e) {
-        // Report 'passed' if CDS was turned off because we could not allocate
-        // the klass metaspace at an address that would work with CDS.
-        output.shouldContain("Could not allocate metaspace at a compatible address");
+        // Report 'passed' if CDS was turned off.
+        output.shouldContain("Unable to use shared archive");
         output.shouldHaveExitValue(1);
       }
     }
--- a/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java	Fri Aug 30 15:42:01 2013 -0700
+++ b/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java	Sun Sep 01 10:37:01 2013 -0400
@@ -69,7 +69,7 @@
                 "-server", "-Xshare:on", "-XX:+UnlockDiagnosticVMOptions",
                 "-XX:SharedArchiveFile=./sample.jsa", "-version");
             output = new OutputAnalyzer(pb.start());
-            output.shouldContain("Could not allocate metaspace at a compatible address");
+            output.shouldContain("Unable to use shared archive");
             output.shouldHaveExitValue(1);
         }
     }
--- a/hotspot/test/runtime/SharedArchiveFile/CdsSameObjectAlignment.java	Fri Aug 30 15:42:01 2013 -0700
+++ b/hotspot/test/runtime/SharedArchiveFile/CdsSameObjectAlignment.java	Sun Sep 01 10:37:01 2013 -0400
@@ -84,7 +84,7 @@
             // there is a chance such reservation will fail
             // If it does, it is NOT considered a failure of the feature,
             // rather a possible expected outcome, though not likely
-            output.shouldContain("Could not allocate metaspace at a compatible address");
+            output.shouldContain("Unable to use shared archive");
             output.shouldHaveExitValue(1);
         }
     }