8023381: VM fails to initialize in runtime/CDSCompressedKPtrs/XShareAuto.java runtime/SharedArchiveFile/CdsSameObjectAlignment.java

Improve handling when CDS archive cannot be mapped

Reviewed-by: kvn, dholmes, mseledtsov
This commit is contained in:
Harold Seigel 2013-09-01 10:37:01 -04:00
parent dac29a1204
commit a320f6a566
4 changed files with 5 additions and 5 deletions

View file

@ -55,6 +55,7 @@ static void fail(const char *msg, va_list ap) {
" shared archive file.\n"); " shared archive file.\n");
jio_vfprintf(defaultStream::error_stream(), msg, ap); jio_vfprintf(defaultStream::error_stream(), msg, ap);
jio_fprintf(defaultStream::error_stream(), "\n"); 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); vm_exit_during_initialization("Unable to use shared archive.", NULL);
} }

View file

@ -51,9 +51,8 @@ public class CDSCompressedKPtrs {
output.shouldHaveExitValue(0); output.shouldHaveExitValue(0);
} catch (RuntimeException e) { } catch (RuntimeException e) {
// Report 'passed' if CDS was turned off because we could not allocate // Report 'passed' if CDS was turned off.
// the klass metaspace at an address that would work with CDS. output.shouldContain("Unable to use shared archive");
output.shouldContain("Could not allocate metaspace at a compatible address");
output.shouldHaveExitValue(1); output.shouldHaveExitValue(1);
} }
} }

View file

@ -69,7 +69,7 @@ public class XShareAuto {
"-server", "-Xshare:on", "-XX:+UnlockDiagnosticVMOptions", "-server", "-Xshare:on", "-XX:+UnlockDiagnosticVMOptions",
"-XX:SharedArchiveFile=./sample.jsa", "-version"); "-XX:SharedArchiveFile=./sample.jsa", "-version");
output = new OutputAnalyzer(pb.start()); 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); output.shouldHaveExitValue(1);
} }
} }

View file

@ -84,7 +84,7 @@ public class CdsSameObjectAlignment {
// there is a chance such reservation will fail // there is a chance such reservation will fail
// If it does, it is NOT considered a failure of the feature, // If it does, it is NOT considered a failure of the feature,
// rather a possible expected outcome, though not likely // 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); output.shouldHaveExitValue(1);
} }
} }