62 }
63 }
64
65 public class ClhsdbCDSCore {
66
67 private static final String TEST_CDS_CORE_FILE_NAME = "cds_core_file";
68 private static final String LOCATIONS_STRING = "location: ";
69 private static final String RUN_SHELL_NO_LIMIT = "ulimit -c unlimited && ";
70 private static final String SHARED_ARCHIVE_NAME = "ArchiveForClhsdbCDSCore.jsa";
71 private static final String CORE_PATTERN_FILE_NAME = "/proc/sys/kernel/core_pattern";
72
73 public static void main(String[] args) throws Exception {
74 System.out.println("Starting ClhsdbCDSCore test");
75 cleanup();
76
77 try {
78 CDSOptions opts = (new CDSOptions()).setArchiveName(SHARED_ARCHIVE_NAME);
79 CDSTestUtils.createArchiveAndCheck(opts);
80
81 String[] jArgs = {
82 "-XX:+UnlockDiagnosticVMOptions",
83 "-XX:SharedArchiveFile=" + SHARED_ARCHIVE_NAME,
84 "-XX:+CreateCoredumpOnCrash",
85 "-Xshare:auto",
86 "-XX:+ProfileInterpreter",
87 "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED",
88 CrashApp.class.getName()
89 };
90
91 OutputAnalyzer crashOut;
92 try {
93 List<String> options = new ArrayList<>();
94 options.addAll(Arrays.asList(jArgs));
95 crashOut =
96 ProcessTools.executeProcess(getTestJavaCommandlineWithPrefix(
97 RUN_SHELL_NO_LIMIT, options.toArray(new String[0])));
98 } catch (Throwable t) {
99 throw new Error("Can't execute the java cds process.", t);
100 }
101
|
62 }
63 }
64
65 public class ClhsdbCDSCore {
66
67 private static final String TEST_CDS_CORE_FILE_NAME = "cds_core_file";
68 private static final String LOCATIONS_STRING = "location: ";
69 private static final String RUN_SHELL_NO_LIMIT = "ulimit -c unlimited && ";
70 private static final String SHARED_ARCHIVE_NAME = "ArchiveForClhsdbCDSCore.jsa";
71 private static final String CORE_PATTERN_FILE_NAME = "/proc/sys/kernel/core_pattern";
72
73 public static void main(String[] args) throws Exception {
74 System.out.println("Starting ClhsdbCDSCore test");
75 cleanup();
76
77 try {
78 CDSOptions opts = (new CDSOptions()).setArchiveName(SHARED_ARCHIVE_NAME);
79 CDSTestUtils.createArchiveAndCheck(opts);
80
81 String[] jArgs = {
82 "-Xmx512m",
83 "-XX:+UnlockDiagnosticVMOptions",
84 "-XX:SharedArchiveFile=" + SHARED_ARCHIVE_NAME,
85 "-XX:+CreateCoredumpOnCrash",
86 "-Xshare:auto",
87 "-XX:+ProfileInterpreter",
88 "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED",
89 CrashApp.class.getName()
90 };
91
92 OutputAnalyzer crashOut;
93 try {
94 List<String> options = new ArrayList<>();
95 options.addAll(Arrays.asList(jArgs));
96 crashOut =
97 ProcessTools.executeProcess(getTestJavaCommandlineWithPrefix(
98 RUN_SHELL_NO_LIMIT, options.toArray(new String[0])));
99 } catch (Throwable t) {
100 throw new Error("Can't execute the java cds process.", t);
101 }
102
|