--- old/test/hotspot/jtreg/runtime/appcds/sharedStrings/SysDictCrash.java 2018-10-29 14:03:01.329854112 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/sharedStrings/SysDictCrash.java 2018-10-29 14:03:00.973840025 -0700 @@ -28,11 +28,9 @@ * @bug 8098821 * @requires vm.cds.archived.java.heap * @library /test/lib /test/hotspot/jtreg/runtime/appcds - * @modules java.base/jdk.internal.misc - * @modules java.management * @run driver SysDictCrash - * @run main/othervm -XX:+UseStringDeduplication SysDictCrash - * @run main/othervm -XX:-CompactStrings SysDictCrash + * @run driver SysDictCrash -XX:+UseStringDeduplication + * @run driver SysDictCrash -XX:-CompactStrings */ import jdk.test.lib.process.OutputAnalyzer; @@ -40,22 +38,26 @@ public class SysDictCrash { public static void main(String[] args) throws Exception { + String vmOptionsPrefix[] = args; + // SharedBaseAddress=0 puts the archive at a very high address on solaris, // which provokes the crash. ProcessBuilder dumpPb = ProcessTools.createJavaProcessBuilder(true, + TestCommon.concat(vmOptionsPrefix, "-XX:+UseG1GC", "-XX:MaxRAMPercentage=12.5", "-cp", ".", "-XX:SharedBaseAddress=0", "-XX:SharedArchiveFile=./SysDictCrash.jsa", "-Xshare:dump", - "-showversion", "-Xlog:cds,cds+hashtables"); + "-showversion", "-Xlog:cds,cds+hashtables")); TestCommon.checkDump(TestCommon.executeAndLog(dumpPb, "dump")); ProcessBuilder runPb = ProcessTools.createJavaProcessBuilder(true, + TestCommon.concat(vmOptionsPrefix, "-XX:+UseG1GC", "-XX:MaxRAMPercentage=12.5", "-XX:SharedArchiveFile=./SysDictCrash.jsa", "-Xshare:on", - "-version"); + "-version")); TestCommon.checkExec(TestCommon.executeAndLog(runPb, "exec")); }