78
79 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
80 "-XX:+UnlockDiagnosticVMOptions",
81 "-Xmx100M",
82 "-XX:ErrorHandlerTest=14",
83 "-XX:+TestUnresponsiveErrorHandler",
84 "-XX:ErrorLogTimeout=" + error_log_timeout,
85 "-XX:-CreateCoredumpOnCrash",
86 "-version");
87
88 OutputAnalyzer output_detail = new OutputAnalyzer(pb.start());
89
90 if (verbose) {
91 System.err.println("<begin cmd output>");
92 System.err.println(output_detail.getOutput());
93 System.err.println("<end cmd output>");
94 }
95
96 // we should have crashed with a SIGSEGV
97 output_detail.shouldMatch("# A fatal error has been detected by the Java Runtime Environment:.*");
98 output_detail.shouldMatch("# +(?:SIGSEGV|EXCEPTION_ACCESS_VIOLATION).*");
99
100 // VM should have been aborted by WatcherThread
101 output_detail.shouldMatch(".*timer expired, abort.*");
102
103 // extract hs-err file
104 String hs_err_file = output_detail.firstMatch("# *(\\S*hs_err_pid\\d+\\.log)", 1);
105 if (hs_err_file == null) {
106 if (!verbose) {
107 System.err.println("<begin cmd output>");
108 System.err.println(output_detail.getOutput());
109 System.err.println("<end cmd output>");
110 }
111 throw new RuntimeException("Did not find hs-err file in output.\n");
112 }
113
114 File f = new File(hs_err_file);
115 if (!f.exists()) {
116 if (!verbose) {
117 System.err.println("<begin cmd output>");
118 System.err.println(output_detail.getOutput());
|
78
79 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
80 "-XX:+UnlockDiagnosticVMOptions",
81 "-Xmx100M",
82 "-XX:ErrorHandlerTest=14",
83 "-XX:+TestUnresponsiveErrorHandler",
84 "-XX:ErrorLogTimeout=" + error_log_timeout,
85 "-XX:-CreateCoredumpOnCrash",
86 "-version");
87
88 OutputAnalyzer output_detail = new OutputAnalyzer(pb.start());
89
90 if (verbose) {
91 System.err.println("<begin cmd output>");
92 System.err.println(output_detail.getOutput());
93 System.err.println("<end cmd output>");
94 }
95
96 // we should have crashed with a SIGSEGV
97 output_detail.shouldMatch("# A fatal error has been detected by the Java Runtime Environment:.*");
98 output_detail.shouldMatch("# +(?:SIGSEGV|SIGBUS|EXCEPTION_ACCESS_VIOLATION).*");
99
100 // VM should have been aborted by WatcherThread
101 output_detail.shouldMatch(".*timer expired, abort.*");
102
103 // extract hs-err file
104 String hs_err_file = output_detail.firstMatch("# *(\\S*hs_err_pid\\d+\\.log)", 1);
105 if (hs_err_file == null) {
106 if (!verbose) {
107 System.err.println("<begin cmd output>");
108 System.err.println(output_detail.getOutput());
109 System.err.println("<end cmd output>");
110 }
111 throw new RuntimeException("Did not find hs-err file in output.\n");
112 }
113
114 File f = new File(hs_err_file);
115 if (!f.exists()) {
116 if (!verbose) {
117 System.err.println("<begin cmd output>");
118 System.err.println(output_detail.getOutput());
|