Mercurial > hg > truffle
annotate src/share/vm/utilities/vmError.cpp @ 2044:06f017f7daa7
Merge.
author | Thomas Wuerthinger <wuerthinger@ssw.jku.at> |
---|---|
date | Fri, 07 Jan 2011 18:18:08 +0100 |
parents | 2d4762ec74af |
children | 36c186bcc085 |
rev | line source |
---|---|
0 | 1 /* |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1490
diff
changeset
|
2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. |
0 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1490
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1490
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1490
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #include "precompiled.hpp" |
26 #include "compiler/compileBroker.hpp" | |
27 #include "gc_interface/collectedHeap.hpp" | |
28 #include "runtime/arguments.hpp" | |
29 #include "runtime/frame.inline.hpp" | |
30 #include "runtime/init.hpp" | |
31 #include "runtime/os.hpp" | |
32 #include "runtime/thread.hpp" | |
33 #include "runtime/vmThread.hpp" | |
34 #include "runtime/vm_operations.hpp" | |
35 #include "utilities/debug.hpp" | |
2022
2d4762ec74af
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
1972
diff
changeset
|
36 #include "utilities/decoder.hpp" |
1972 | 37 #include "utilities/defaultStream.hpp" |
38 #include "utilities/top.hpp" | |
39 #include "utilities/vmError.hpp" | |
0 | 40 |
41 // List of environment variables that should be reported in error log file. | |
42 const char *env_list[] = { | |
43 // All platforms | |
44 "JAVA_HOME", "JRE_HOME", "JAVA_TOOL_OPTIONS", "_JAVA_OPTIONS", "CLASSPATH", | |
45 "JAVA_COMPILER", "PATH", "USERNAME", | |
46 | |
47 // Env variables that are defined on Solaris/Linux | |
48 "LD_LIBRARY_PATH", "LD_PRELOAD", "SHELL", "DISPLAY", | |
49 "HOSTTYPE", "OSTYPE", "ARCH", "MACHTYPE", | |
50 | |
51 // defined on Linux | |
52 "LD_ASSUME_KERNEL", "_JAVA_SR_SIGNUM", | |
53 | |
54 // defined on Windows | |
55 "OS", "PROCESSOR_IDENTIFIER", "_ALT_JAVA_HOME_DIR", | |
56 | |
57 (const char *)0 | |
58 }; | |
59 | |
60 // Fatal error handler for internal errors and crashes. | |
61 // | |
62 // The default behavior of fatal error handler is to print a brief message | |
63 // to standard out (defaultStream::output_fd()), then save detailed information | |
64 // into an error report file (hs_err_pid<pid>.log) and abort VM. If multiple | |
65 // threads are having troubles at the same time, only one error is reported. | |
66 // The thread that is reporting error will abort VM when it is done, all other | |
67 // threads are blocked forever inside report_and_die(). | |
68 | |
69 // Constructor for crashes | |
70 VMError::VMError(Thread* thread, int sig, address pc, void* siginfo, void* context) { | |
71 _thread = thread; | |
72 _id = sig; | |
73 _pc = pc; | |
74 _siginfo = siginfo; | |
75 _context = context; | |
76 | |
77 _verbose = false; | |
78 _current_step = 0; | |
79 _current_step_info = NULL; | |
80 | |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
81 _message = NULL; |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
82 _detail_msg = NULL; |
0 | 83 _filename = NULL; |
84 _lineno = 0; | |
85 | |
86 _size = 0; | |
87 } | |
88 | |
89 // Constructor for internal errors | |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
90 VMError::VMError(Thread* thread, const char* filename, int lineno, |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
91 const char* message, const char * detail_msg) |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
92 { |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
93 _thread = thread; |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
94 _id = internal_error; // Value that's not an OS exception/signal |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
95 _filename = filename; |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
96 _lineno = lineno; |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
97 _message = message; |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
98 _detail_msg = detail_msg; |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
99 |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
100 _verbose = false; |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
101 _current_step = 0; |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
102 _current_step_info = NULL; |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
103 |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
104 _pc = NULL; |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
105 _siginfo = NULL; |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
106 _context = NULL; |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
107 |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
108 _size = 0; |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
109 } |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
110 |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
111 // Constructor for OOM errors |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
112 VMError::VMError(Thread* thread, const char* filename, int lineno, size_t size, |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
113 const char* message) { |
0 | 114 _thread = thread; |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
115 _id = oom_error; // Value that's not an OS exception/signal |
0 | 116 _filename = filename; |
117 _lineno = lineno; | |
118 _message = message; | |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
119 _detail_msg = NULL; |
0 | 120 |
121 _verbose = false; | |
122 _current_step = 0; | |
123 _current_step_info = NULL; | |
124 | |
125 _pc = NULL; | |
126 _siginfo = NULL; | |
127 _context = NULL; | |
128 | |
129 _size = size; | |
130 } | |
131 | |
132 | |
133 // Constructor for non-fatal errors | |
134 VMError::VMError(const char* message) { | |
135 _thread = NULL; | |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
136 _id = internal_error; // Value that's not an OS exception/signal |
0 | 137 _filename = NULL; |
138 _lineno = 0; | |
139 _message = message; | |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
140 _detail_msg = NULL; |
0 | 141 |
142 _verbose = false; | |
143 _current_step = 0; | |
144 _current_step_info = NULL; | |
145 | |
146 _pc = NULL; | |
147 _siginfo = NULL; | |
148 _context = NULL; | |
149 | |
150 _size = 0; | |
151 } | |
152 | |
153 // -XX:OnError=<string>, where <string> can be a list of commands, separated | |
154 // by ';'. "%p" is replaced by current process id (pid); "%%" is replaced by | |
155 // a single "%". Some examples: | |
156 // | |
157 // -XX:OnError="pmap %p" // show memory map | |
158 // -XX:OnError="gcore %p; dbx - %p" // dump core and launch debugger | |
159 // -XX:OnError="cat hs_err_pid%p.log | mail my_email@sun.com" | |
160 // -XX:OnError="kill -9 %p" // ?#!@# | |
161 | |
162 // A simple parser for -XX:OnError, usage: | |
163 // ptr = OnError; | |
164 // while ((cmd = next_OnError_command(buffer, sizeof(buffer), &ptr) != NULL) | |
165 // ... ... | |
166 static char* next_OnError_command(char* buf, int buflen, const char** ptr) { | |
167 if (ptr == NULL || *ptr == NULL) return NULL; | |
168 | |
169 const char* cmd = *ptr; | |
170 | |
171 // skip leading blanks or ';' | |
172 while (*cmd == ' ' || *cmd == ';') cmd++; | |
173 | |
174 if (*cmd == '\0') return NULL; | |
175 | |
176 const char * cmdend = cmd; | |
177 while (*cmdend != '\0' && *cmdend != ';') cmdend++; | |
178 | |
179 Arguments::copy_expand_pid(cmd, cmdend - cmd, buf, buflen); | |
180 | |
181 *ptr = (*cmdend == '\0' ? cmdend : cmdend + 1); | |
182 return buf; | |
183 } | |
184 | |
185 | |
186 static void print_bug_submit_message(outputStream *out, Thread *thread) { | |
187 if (out == NULL) return; | |
188 out->print_raw_cr("# If you would like to submit a bug report, please visit:"); | |
189 out->print_raw ("# "); | |
190 out->print_raw_cr(Arguments::java_vendor_url_bug()); | |
191 // If the crash is in native code, encourage user to submit a bug to the | |
192 // provider of that code. | |
56
31d829b33f26
6549844: Wording problems in "An unexpected error ..."
coleenp
parents:
0
diff
changeset
|
193 if (thread && thread->is_Java_thread() && |
31d829b33f26
6549844: Wording problems in "An unexpected error ..."
coleenp
parents:
0
diff
changeset
|
194 !thread->is_hidden_from_external_view()) { |
0 | 195 JavaThread* jt = (JavaThread*)thread; |
196 if (jt->thread_state() == _thread_in_native) { | |
197 out->print_cr("# The crash happened outside the Java Virtual Machine in native code.\n# See problematic frame for where to report the bug."); | |
198 } | |
199 } | |
200 out->print_raw_cr("#"); | |
201 } | |
202 | |
203 | |
204 // Return a string to describe the error | |
205 char* VMError::error_string(char* buf, int buflen) { | |
206 char signame_buf[64]; | |
207 const char *signame = os::exception_name(_id, signame_buf, sizeof(signame_buf)); | |
208 | |
209 if (signame) { | |
210 jio_snprintf(buf, buflen, | |
211 "%s (0x%x) at pc=" PTR_FORMAT ", pid=%d, tid=" UINTX_FORMAT, | |
212 signame, _id, _pc, | |
213 os::current_process_id(), os::current_thread_id()); | |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
214 } else if (_filename != NULL && _lineno > 0) { |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
215 // skip directory names |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
216 char separator = os::file_separator()[0]; |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
217 const char *p = strrchr(_filename, separator); |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
218 int n = jio_snprintf(buf, buflen, |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
219 "Internal Error at %s:%d, pid=%d, tid=" UINTX_FORMAT, |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
220 p ? p + 1 : _filename, _lineno, |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
221 os::current_process_id(), os::current_thread_id()); |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
222 if (n >= 0 && n < buflen && _message) { |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
223 if (_detail_msg) { |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
224 jio_snprintf(buf + n, buflen - n, "%s%s: %s", |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
225 os::line_separator(), _message, _detail_msg); |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
226 } else { |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
227 jio_snprintf(buf + n, buflen - n, "%sError: %s", |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
228 os::line_separator(), _message); |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
229 } |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
230 } |
0 | 231 } else { |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
232 jio_snprintf(buf, buflen, |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
233 "Internal Error (0x%x), pid=%d, tid=" UINTX_FORMAT, |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
234 _id, os::current_process_id(), os::current_thread_id()); |
0 | 235 } |
236 | |
237 return buf; | |
238 } | |
239 | |
1384 | 240 void VMError::print_stack_trace(outputStream* st, JavaThread* jt, |
241 char* buf, int buflen, bool verbose) { | |
242 #ifdef ZERO | |
243 if (jt->zero_stack()->sp() && jt->top_zero_frame()) { | |
244 // StackFrameStream uses the frame anchor, which may not have | |
245 // been set up. This can be done at any time in Zero, however, | |
246 // so if it hasn't been set up then we just set it up now and | |
247 // clear it again when we're done. | |
248 bool has_last_Java_frame = jt->has_last_Java_frame(); | |
249 if (!has_last_Java_frame) | |
250 jt->set_last_Java_frame(); | |
251 st->print("Java frames:"); | |
252 | |
253 // If the top frame is a Shark frame and the frame anchor isn't | |
254 // set up then it's possible that the information in the frame | |
255 // is garbage: it could be from a previous decache, or it could | |
256 // simply have never been written. So we print a warning... | |
257 StackFrameStream sfs(jt); | |
258 if (!has_last_Java_frame && !sfs.is_done()) { | |
259 if (sfs.current()->zeroframe()->is_shark_frame()) { | |
260 st->print(" (TOP FRAME MAY BE JUNK)"); | |
261 } | |
262 } | |
263 st->cr(); | |
264 | |
265 // Print the frames | |
266 for(int i = 0; !sfs.is_done(); sfs.next(), i++) { | |
267 sfs.current()->zero_print_on_error(i, st, buf, buflen); | |
268 st->cr(); | |
269 } | |
270 | |
271 // Reset the frame anchor if necessary | |
272 if (!has_last_Java_frame) | |
273 jt->reset_last_Java_frame(); | |
274 } | |
275 #else | |
276 if (jt->has_last_Java_frame()) { | |
277 st->print_cr("Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)"); | |
278 for(StackFrameStream sfs(jt); !sfs.is_done(); sfs.next()) { | |
279 sfs.current()->print_on_error(st, buf, buflen, verbose); | |
280 st->cr(); | |
281 } | |
282 } | |
283 #endif // ZERO | |
284 } | |
0 | 285 |
286 // This is the main function to report a fatal error. Only one thread can | |
287 // call this function, so we don't need to worry about MT-safety. But it's | |
288 // possible that the error handler itself may crash or die on an internal | |
289 // error, for example, when the stack/heap is badly damaged. We must be | |
290 // able to handle recursive errors that happen inside error handler. | |
291 // | |
292 // Error reporting is done in several steps. If a crash or internal error | |
293 // occurred when reporting an error, the nested signal/exception handler | |
294 // can skip steps that are already (or partially) done. Error reporting will | |
295 // continue from the next step. This allows us to retrieve and print | |
296 // information that may be unsafe to get after a fatal error. If it happens, | |
297 // you may find nested report_and_die() frames when you look at the stack | |
298 // in a debugger. | |
299 // | |
300 // In general, a hang in error handler is much worse than a crash or internal | |
301 // error, as it's harder to recover from a hang. Deadlock can happen if we | |
302 // try to grab a lock that is already owned by current thread, or if the | |
303 // owner is blocked forever (e.g. in os::infinite_sleep()). If possible, the | |
304 // error handler and all the functions it called should avoid grabbing any | |
305 // lock. An important thing to notice is that memory allocation needs a lock. | |
306 // | |
307 // We should avoid using large stack allocated buffers. Many errors happen | |
308 // when stack space is already low. Making things even worse is that there | |
309 // could be nested report_and_die() calls on stack (see above). Only one | |
310 // thread can report error, so large buffers are statically allocated in data | |
311 // segment. | |
312 | |
313 void VMError::report(outputStream* st) { | |
314 # define BEGIN if (_current_step == 0) { _current_step = 1; | |
315 # define STEP(n, s) } if (_current_step < n) { _current_step = n; _current_step_info = s; | |
316 # define END } | |
317 | |
318 // don't allocate large buffer on stack | |
319 static char buf[O_BUFLEN]; | |
320 | |
321 BEGIN | |
322 | |
56
31d829b33f26
6549844: Wording problems in "An unexpected error ..."
coleenp
parents:
0
diff
changeset
|
323 STEP(10, "(printing fatal error message)") |
0 | 324 |
325 st->print_cr("#"); | |
56
31d829b33f26
6549844: Wording problems in "An unexpected error ..."
coleenp
parents:
0
diff
changeset
|
326 st->print_cr("# A fatal error has been detected by the Java Runtime Environment:"); |
0 | 327 |
328 STEP(15, "(printing type of error)") | |
329 | |
330 switch(_id) { | |
331 case oom_error: | |
332 st->print_cr("#"); | |
333 st->print("# java.lang.OutOfMemoryError: "); | |
334 if (_size) { | |
335 st->print("requested "); | |
420
a1980da045cc
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
196
diff
changeset
|
336 sprintf(buf,SIZE_FORMAT,_size); |
0 | 337 st->print(buf); |
338 st->print(" bytes"); | |
339 if (_message != NULL) { | |
340 st->print(" for "); | |
341 st->print(_message); | |
342 } | |
343 st->print_cr(". Out of swap space?"); | |
344 } else { | |
345 if (_message != NULL) | |
346 st->print_cr(_message); | |
347 } | |
348 break; | |
349 case internal_error: | |
350 default: | |
351 break; | |
352 } | |
353 | |
354 STEP(20, "(printing exception/signal name)") | |
355 | |
356 st->print_cr("#"); | |
357 st->print("# "); | |
358 // Is it an OS exception/signal? | |
359 if (os::exception_name(_id, buf, sizeof(buf))) { | |
360 st->print("%s", buf); | |
361 st->print(" (0x%x)", _id); // signal number | |
362 st->print(" at pc=" PTR_FORMAT, _pc); | |
363 } else { | |
364 st->print("Internal Error"); | |
365 if (_filename != NULL && _lineno > 0) { | |
366 #ifdef PRODUCT | |
367 // In product mode chop off pathname? | |
368 char separator = os::file_separator()[0]; | |
369 const char *p = strrchr(_filename, separator); | |
370 const char *file = p ? p+1 : _filename; | |
371 #else | |
372 const char *file = _filename; | |
373 #endif | |
374 size_t len = strlen(file); | |
375 size_t buflen = sizeof(buf); | |
376 | |
377 strncpy(buf, file, buflen); | |
378 if (len + 10 < buflen) { | |
603
dbbe28fc66b5
6778669: Patch from Red Hat -- fixes compilation errors
twisti
parents:
511
diff
changeset
|
379 sprintf(buf + len, ":%d", _lineno); |
0 | 380 } |
381 st->print(" (%s)", buf); | |
382 } else { | |
383 st->print(" (0x%x)", _id); | |
384 } | |
385 } | |
386 | |
387 STEP(30, "(printing current thread and pid)") | |
388 | |
389 // process id, thread id | |
390 st->print(", pid=%d", os::current_process_id()); | |
391 st->print(", tid=" UINTX_FORMAT, os::current_thread_id()); | |
392 st->cr(); | |
393 | |
394 STEP(40, "(printing error message)") | |
395 | |
396 // error message | |
1490
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
397 if (_detail_msg) { |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
398 st->print_cr("# %s: %s", _message ? _message : "Error", _detail_msg); |
f03d0a26bf83
6888954: argument formatting for assert() and friends
jcoomes
parents:
1384
diff
changeset
|
399 } else if (_message) { |
0 | 400 st->print_cr("# Error: %s", _message); |
401 } | |
402 | |
403 STEP(50, "(printing Java version string)") | |
404 | |
405 // VM version | |
406 st->print_cr("#"); | |
473
3ad2b8576c4a
6689685: Hotspot crash error message should include libraries version
coleenp
parents:
420
diff
changeset
|
407 JDK_Version::current().to_string(buf, sizeof(buf)); |
3ad2b8576c4a
6689685: Hotspot crash error message should include libraries version
coleenp
parents:
420
diff
changeset
|
408 st->print_cr("# JRE version: %s", buf); |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
56
diff
changeset
|
409 st->print_cr("# Java VM: %s (%s %s %s %s)", |
0 | 410 Abstract_VM_Version::vm_name(), |
411 Abstract_VM_Version::vm_release(), | |
412 Abstract_VM_Version::vm_info_string(), | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
56
diff
changeset
|
413 Abstract_VM_Version::vm_platform_string(), |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
56
diff
changeset
|
414 UseCompressedOops ? "compressed oops" : "" |
0 | 415 ); |
416 | |
417 STEP(60, "(printing problematic frame)") | |
418 | |
419 // Print current frame if we have a context (i.e. it's a crash) | |
420 if (_context) { | |
421 st->print_cr("# Problematic frame:"); | |
422 st->print("# "); | |
423 frame fr = os::fetch_frame_from_context(_context); | |
424 fr.print_on_error(st, buf, sizeof(buf)); | |
425 st->cr(); | |
426 st->print_cr("#"); | |
427 } | |
428 | |
429 STEP(65, "(printing bug submit message)") | |
430 | |
431 if (_verbose) print_bug_submit_message(st, _thread); | |
432 | |
433 STEP(70, "(printing thread)" ) | |
434 | |
435 if (_verbose) { | |
436 st->cr(); | |
437 st->print_cr("--------------- T H R E A D ---------------"); | |
438 st->cr(); | |
439 } | |
440 | |
441 STEP(80, "(printing current thread)" ) | |
442 | |
443 // current thread | |
444 if (_verbose) { | |
445 if (_thread) { | |
446 st->print("Current thread (" PTR_FORMAT "): ", _thread); | |
447 _thread->print_on_error(st, buf, sizeof(buf)); | |
448 st->cr(); | |
449 } else { | |
450 st->print_cr("Current thread is native thread"); | |
451 } | |
452 st->cr(); | |
453 } | |
454 | |
455 STEP(90, "(printing siginfo)" ) | |
456 | |
457 // signal no, signal code, address that caused the fault | |
458 if (_verbose && _siginfo) { | |
459 os::print_siginfo(st, _siginfo); | |
460 st->cr(); | |
461 } | |
462 | |
463 STEP(100, "(printing registers, top of stack, instructions near pc)") | |
464 | |
465 // registers, top of stack, instructions near pc | |
466 if (_verbose && _context) { | |
467 os::print_context(st, _context); | |
468 st->cr(); | |
469 } | |
470 | |
1907 | 471 STEP(105, "(printing register info)") |
472 | |
473 // decode register contents if possible | |
474 if (_verbose && _context && Universe::is_fully_initialized()) { | |
475 os::print_register_info(st, _context); | |
476 st->cr(); | |
477 } | |
478 | |
0 | 479 STEP(110, "(printing stack bounds)" ) |
480 | |
481 if (_verbose) { | |
482 st->print("Stack: "); | |
483 | |
484 address stack_top; | |
485 size_t stack_size; | |
486 | |
487 if (_thread) { | |
488 stack_top = _thread->stack_base(); | |
489 stack_size = _thread->stack_size(); | |
490 } else { | |
491 stack_top = os::current_stack_base(); | |
492 stack_size = os::current_stack_size(); | |
493 } | |
494 | |
495 address stack_bottom = stack_top - stack_size; | |
496 st->print("[" PTR_FORMAT "," PTR_FORMAT "]", stack_bottom, stack_top); | |
497 | |
498 frame fr = _context ? os::fetch_frame_from_context(_context) | |
499 : os::current_frame(); | |
500 | |
501 if (fr.sp()) { | |
502 st->print(", sp=" PTR_FORMAT, fr.sp()); | |
1684
66c5dadb4d61
6973308: Missing zero length check before repne scas in check_klass_subtype_slow_path()
kvn
parents:
1552
diff
changeset
|
503 size_t free_stack_size = pointer_delta(fr.sp(), stack_bottom, 1024); |
66c5dadb4d61
6973308: Missing zero length check before repne scas in check_klass_subtype_slow_path()
kvn
parents:
1552
diff
changeset
|
504 st->print(", free space=" SIZE_FORMAT "k", free_stack_size); |
0 | 505 } |
506 | |
507 st->cr(); | |
508 } | |
509 | |
510 STEP(120, "(printing native stack)" ) | |
511 | |
512 if (_verbose) { | |
513 frame fr = _context ? os::fetch_frame_from_context(_context) | |
514 : os::current_frame(); | |
515 | |
516 // see if it's a valid frame | |
517 if (fr.pc()) { | |
518 st->print_cr("Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)"); | |
519 | |
2022
2d4762ec74af
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
1972
diff
changeset
|
520 // initialize decoder to decode C frames |
2d4762ec74af
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
1972
diff
changeset
|
521 Decoder decoder; |
2d4762ec74af
7003748: Decode C stack frames when symbols are presented (PhoneHome project)
zgu
parents:
1972
diff
changeset
|
522 |
0 | 523 int count = 0; |
524 while (count++ < StackPrintLimit) { | |
525 fr.print_on_error(st, buf, sizeof(buf)); | |
526 st->cr(); | |
527 if (os::is_first_C_frame(&fr)) break; | |
528 fr = os::get_sender_for_C_frame(&fr); | |
529 } | |
530 | |
531 if (count > StackPrintLimit) { | |
532 st->print_cr("...<more frames>..."); | |
533 } | |
534 | |
535 st->cr(); | |
536 } | |
537 } | |
538 | |
539 STEP(130, "(printing Java stack)" ) | |
540 | |
541 if (_verbose && _thread && _thread->is_Java_thread()) { | |
1384 | 542 print_stack_trace(st, (JavaThread*)_thread, buf, sizeof(buf)); |
0 | 543 } |
544 | |
1119
547f81740344
6361589: Print out stack trace for target thread of GC crash
minqi
parents:
1010
diff
changeset
|
545 STEP(135, "(printing target Java thread stack)" ) |
547f81740344
6361589: Print out stack trace for target thread of GC crash
minqi
parents:
1010
diff
changeset
|
546 |
547f81740344
6361589: Print out stack trace for target thread of GC crash
minqi
parents:
1010
diff
changeset
|
547 // printing Java thread stack trace if it is involved in GC crash |
1907 | 548 if (_verbose && _thread && (_thread->is_Named_thread())) { |
1119
547f81740344
6361589: Print out stack trace for target thread of GC crash
minqi
parents:
1010
diff
changeset
|
549 JavaThread* jt = ((NamedThread *)_thread)->processed_thread(); |
547f81740344
6361589: Print out stack trace for target thread of GC crash
minqi
parents:
1010
diff
changeset
|
550 if (jt != NULL) { |
547f81740344
6361589: Print out stack trace for target thread of GC crash
minqi
parents:
1010
diff
changeset
|
551 st->print_cr("JavaThread " PTR_FORMAT " (nid = " UINTX_FORMAT ") was being processed", jt, jt->osthread()->thread_id()); |
1384 | 552 print_stack_trace(st, jt, buf, sizeof(buf), true); |
1119
547f81740344
6361589: Print out stack trace for target thread of GC crash
minqi
parents:
1010
diff
changeset
|
553 } |
547f81740344
6361589: Print out stack trace for target thread of GC crash
minqi
parents:
1010
diff
changeset
|
554 } |
547f81740344
6361589: Print out stack trace for target thread of GC crash
minqi
parents:
1010
diff
changeset
|
555 |
0 | 556 STEP(140, "(printing VM operation)" ) |
557 | |
558 if (_verbose && _thread && _thread->is_VM_thread()) { | |
559 VMThread* t = (VMThread*)_thread; | |
560 VM_Operation* op = t->vm_operation(); | |
561 if (op) { | |
562 op->print_on_error(st); | |
563 st->cr(); | |
564 st->cr(); | |
565 } | |
566 } | |
567 | |
568 STEP(150, "(printing current compile task)" ) | |
569 | |
570 if (_verbose && _thread && _thread->is_Compiler_thread()) { | |
571 CompilerThread* t = (CompilerThread*)_thread; | |
572 if (t->task()) { | |
573 st->cr(); | |
574 st->print_cr("Current CompileTask:"); | |
575 t->task()->print_line_on_error(st, buf, sizeof(buf)); | |
576 st->cr(); | |
577 } | |
578 } | |
579 | |
580 STEP(160, "(printing process)" ) | |
581 | |
582 if (_verbose) { | |
583 st->cr(); | |
584 st->print_cr("--------------- P R O C E S S ---------------"); | |
585 st->cr(); | |
586 } | |
587 | |
588 STEP(170, "(printing all threads)" ) | |
589 | |
590 // all threads | |
591 if (_verbose && _thread) { | |
592 Threads::print_on_error(st, _thread, buf, sizeof(buf)); | |
593 st->cr(); | |
594 } | |
595 | |
596 STEP(175, "(printing VM state)" ) | |
597 | |
598 if (_verbose) { | |
599 // Safepoint state | |
600 st->print("VM state:"); | |
601 | |
602 if (SafepointSynchronize::is_synchronizing()) st->print("synchronizing"); | |
603 else if (SafepointSynchronize::is_at_safepoint()) st->print("at safepoint"); | |
604 else st->print("not at safepoint"); | |
605 | |
606 // Also see if error occurred during initialization or shutdown | |
607 if (!Universe::is_fully_initialized()) { | |
608 st->print(" (not fully initialized)"); | |
609 } else if (VM_Exit::vm_exited()) { | |
610 st->print(" (shutting down)"); | |
611 } else { | |
612 st->print(" (normal execution)"); | |
613 } | |
614 st->cr(); | |
615 st->cr(); | |
616 } | |
617 | |
618 STEP(180, "(printing owned locks on error)" ) | |
619 | |
620 // mutexes/monitors that currently have an owner | |
621 if (_verbose) { | |
622 print_owned_locks_on_error(st); | |
623 st->cr(); | |
624 } | |
625 | |
626 STEP(190, "(printing heap information)" ) | |
627 | |
628 if (_verbose && Universe::is_fully_initialized()) { | |
629 // print heap information before vm abort | |
630 Universe::print_on(st); | |
631 st->cr(); | |
632 } | |
633 | |
1907 | 634 STEP(195, "(printing code cache information)" ) |
635 | |
636 if (_verbose && Universe::is_fully_initialized()) { | |
637 // print code cache information before vm abort | |
638 CodeCache::print_bounds(st); | |
639 st->cr(); | |
640 } | |
641 | |
0 | 642 STEP(200, "(printing dynamic libraries)" ) |
643 | |
644 if (_verbose) { | |
645 // dynamic libraries, or memory map | |
646 os::print_dll_info(st); | |
647 st->cr(); | |
648 } | |
649 | |
650 STEP(210, "(printing VM options)" ) | |
651 | |
652 if (_verbose) { | |
653 // VM options | |
654 Arguments::print_on(st); | |
655 st->cr(); | |
656 } | |
657 | |
658 STEP(220, "(printing environment variables)" ) | |
659 | |
660 if (_verbose) { | |
661 os::print_environment_variables(st, env_list, buf, sizeof(buf)); | |
662 st->cr(); | |
663 } | |
664 | |
665 STEP(225, "(printing signal handlers)" ) | |
666 | |
667 if (_verbose) { | |
668 os::print_signal_handlers(st, buf, sizeof(buf)); | |
669 st->cr(); | |
670 } | |
671 | |
672 STEP(230, "" ) | |
673 | |
674 if (_verbose) { | |
675 st->cr(); | |
676 st->print_cr("--------------- S Y S T E M ---------------"); | |
677 st->cr(); | |
678 } | |
679 | |
680 STEP(240, "(printing OS information)" ) | |
681 | |
682 if (_verbose) { | |
683 os::print_os_info(st); | |
684 st->cr(); | |
685 } | |
686 | |
687 STEP(250, "(printing CPU info)" ) | |
688 if (_verbose) { | |
689 os::print_cpu_info(st); | |
690 st->cr(); | |
691 } | |
692 | |
693 STEP(260, "(printing memory info)" ) | |
694 | |
695 if (_verbose) { | |
696 os::print_memory_info(st); | |
697 st->cr(); | |
698 } | |
699 | |
700 STEP(270, "(printing internal vm info)" ) | |
701 | |
702 if (_verbose) { | |
703 st->print_cr("vm_info: %s", Abstract_VM_Version::internal_vm_info_string()); | |
704 st->cr(); | |
705 } | |
706 | |
707 STEP(280, "(printing date and time)" ) | |
708 | |
709 if (_verbose) { | |
710 os::print_date_and_time(st); | |
711 st->cr(); | |
712 } | |
713 | |
714 END | |
715 | |
716 # undef BEGIN | |
717 # undef STEP | |
718 # undef END | |
719 } | |
720 | |
1681
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
721 VMError* volatile VMError::first_error = NULL; |
126ea7725993
6953477: Increase portability and flexibility of building Hotspot
bobv
parents:
1552
diff
changeset
|
722 volatile jlong VMError::first_error_tid = -1; |
0 | 723 |
724 void VMError::report_and_die() { | |
725 // Don't allocate large buffer on stack | |
726 static char buffer[O_BUFLEN]; | |
727 | |
728 // An error could happen before tty is initialized or after it has been | |
729 // destroyed. Here we use a very simple unbuffered fdStream for printing. | |
730 // Only out.print_raw() and out.print_raw_cr() should be used, as other | |
731 // printing methods need to allocate large buffer on stack. To format a | |
732 // string, use jio_snprintf() with a static buffer or use staticBufferStream. | |
733 static fdStream out(defaultStream::output_fd()); | |
734 | |
735 // How many errors occurred in error handler when reporting first_error. | |
736 static int recursive_error_count; | |
737 | |
738 // We will first print a brief message to standard out (verbose = false), | |
739 // then save detailed information in log file (verbose = true). | |
740 static bool out_done = false; // done printing to standard out | |
741 static bool log_done = false; // done saving error log | |
742 static fdStream log; // error log | |
743 | |
744 if (SuppressFatalErrorMessage) { | |
745 os::abort(); | |
746 } | |
747 jlong mytid = os::current_thread_id(); | |
748 if (first_error == NULL && | |
749 Atomic::cmpxchg_ptr(this, &first_error, NULL) == NULL) { | |
750 | |
751 // first time | |
752 first_error_tid = mytid; | |
753 set_error_reported(); | |
754 | |
755 if (ShowMessageBoxOnError) { | |
756 show_message_box(buffer, sizeof(buffer)); | |
757 | |
758 // User has asked JVM to abort. Reset ShowMessageBoxOnError so the | |
759 // WatcherThread can kill JVM if the error handler hangs. | |
760 ShowMessageBoxOnError = false; | |
761 } | |
762 | |
763 // reset signal handlers or exception filter; make sure recursive crashes | |
764 // are handled properly. | |
765 reset_signal_handlers(); | |
766 | |
767 } else { | |
511
dabd8d202164
4997835: RFE: crash dump will only be created when running w/ -XX:+ShowMessageBoxOnError
coleenp
parents:
473
diff
changeset
|
768 // If UseOsErrorReporting we call this for each level of the call stack |
dabd8d202164
4997835: RFE: crash dump will only be created when running w/ -XX:+ShowMessageBoxOnError
coleenp
parents:
473
diff
changeset
|
769 // while searching for the exception handler. Only the first level needs |
dabd8d202164
4997835: RFE: crash dump will only be created when running w/ -XX:+ShowMessageBoxOnError
coleenp
parents:
473
diff
changeset
|
770 // to be reported. |
dabd8d202164
4997835: RFE: crash dump will only be created when running w/ -XX:+ShowMessageBoxOnError
coleenp
parents:
473
diff
changeset
|
771 if (UseOSErrorReporting && log_done) return; |
dabd8d202164
4997835: RFE: crash dump will only be created when running w/ -XX:+ShowMessageBoxOnError
coleenp
parents:
473
diff
changeset
|
772 |
0 | 773 // This is not the first error, see if it happened in a different thread |
774 // or in the same thread during error reporting. | |
775 if (first_error_tid != mytid) { | |
776 jio_snprintf(buffer, sizeof(buffer), | |
777 "[thread " INT64_FORMAT " also had an error]", | |
778 mytid); | |
779 out.print_raw_cr(buffer); | |
780 | |
781 // error reporting is not MT-safe, block current thread | |
782 os::infinite_sleep(); | |
783 | |
784 } else { | |
785 if (recursive_error_count++ > 30) { | |
786 out.print_raw_cr("[Too many errors, abort]"); | |
787 os::die(); | |
788 } | |
789 | |
790 jio_snprintf(buffer, sizeof(buffer), | |
791 "[error occurred during error reporting %s, id 0x%x]", | |
792 first_error ? first_error->_current_step_info : "", | |
793 _id); | |
794 if (log.is_open()) { | |
795 log.cr(); | |
796 log.print_raw_cr(buffer); | |
797 log.cr(); | |
798 } else { | |
799 out.cr(); | |
800 out.print_raw_cr(buffer); | |
801 out.cr(); | |
802 } | |
803 } | |
804 } | |
805 | |
806 // print to screen | |
807 if (!out_done) { | |
808 first_error->_verbose = false; | |
809 | |
810 staticBufferStream sbs(buffer, sizeof(buffer), &out); | |
811 first_error->report(&sbs); | |
812 | |
813 out_done = true; | |
814 | |
815 first_error->_current_step = 0; // reset current_step | |
816 first_error->_current_step_info = ""; // reset current_step string | |
817 } | |
818 | |
819 // print to error log file | |
820 if (!log_done) { | |
821 first_error->_verbose = true; | |
822 | |
823 // see if log file is already open | |
824 if (!log.is_open()) { | |
825 // open log file | |
826 int fd = -1; | |
827 | |
828 if (ErrorFile != NULL) { | |
829 bool copy_ok = | |
830 Arguments::copy_expand_pid(ErrorFile, strlen(ErrorFile), buffer, sizeof(buffer)); | |
831 if (copy_ok) { | |
832 fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC, 0666); | |
833 } | |
834 } | |
835 | |
836 if (fd == -1) { | |
837 const char *cwd = os::get_current_directory(buffer, sizeof(buffer)); | |
838 size_t len = strlen(cwd); | |
839 // either user didn't specify, or the user's location failed, | |
840 // so use the default name in the current directory | |
841 jio_snprintf(&buffer[len], sizeof(buffer)-len, "%shs_err_pid%u.log", | |
842 os::file_separator(), os::current_process_id()); | |
843 fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC, 0666); | |
844 } | |
845 | |
846 if (fd == -1) { | |
847 // try temp directory | |
848 const char * tmpdir = os::get_temp_directory(); | |
1353
a2ea687fdc7c
6938627: Make temporary directory use property java.io.tmpdir when specified
coleenp
parents:
1119
diff
changeset
|
849 jio_snprintf(buffer, sizeof(buffer), "%s%shs_err_pid%u.log", |
a2ea687fdc7c
6938627: Make temporary directory use property java.io.tmpdir when specified
coleenp
parents:
1119
diff
changeset
|
850 tmpdir, os::file_separator(), os::current_process_id()); |
0 | 851 fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC, 0666); |
852 } | |
853 | |
854 if (fd != -1) { | |
855 out.print_raw("# An error report file with more information is saved as:\n# "); | |
856 out.print_raw_cr(buffer); | |
857 os::set_error_file(buffer); | |
858 | |
859 log.set_fd(fd); | |
860 } else { | |
861 out.print_raw_cr("# Can not save log file, dump to screen.."); | |
862 log.set_fd(defaultStream::output_fd()); | |
863 } | |
864 } | |
865 | |
866 staticBufferStream sbs(buffer, O_BUFLEN, &log); | |
867 first_error->report(&sbs); | |
868 first_error->_current_step = 0; // reset current_step | |
869 first_error->_current_step_info = ""; // reset current_step string | |
870 | |
871 if (log.fd() != defaultStream::output_fd()) { | |
872 close(log.fd()); | |
873 } | |
874 | |
875 log.set_fd(-1); | |
876 log_done = true; | |
877 } | |
878 | |
879 | |
880 static bool skip_OnError = false; | |
881 if (!skip_OnError && OnError && OnError[0]) { | |
882 skip_OnError = true; | |
883 | |
884 out.print_raw_cr("#"); | |
885 out.print_raw ("# -XX:OnError=\""); | |
886 out.print_raw (OnError); | |
887 out.print_raw_cr("\""); | |
888 | |
889 char* cmd; | |
890 const char* ptr = OnError; | |
891 while ((cmd = next_OnError_command(buffer, sizeof(buffer), &ptr)) != NULL){ | |
892 out.print_raw ("# Executing "); | |
893 #if defined(LINUX) | |
894 out.print_raw ("/bin/sh -c "); | |
895 #elif defined(SOLARIS) | |
896 out.print_raw ("/usr/bin/sh -c "); | |
897 #endif | |
898 out.print_raw ("\""); | |
899 out.print_raw (cmd); | |
900 out.print_raw_cr("\" ..."); | |
901 | |
902 os::fork_and_exec(cmd); | |
903 } | |
904 | |
905 // done with OnError | |
906 OnError = NULL; | |
907 } | |
908 | |
909 static bool skip_bug_url = false; | |
910 if (!skip_bug_url) { | |
911 skip_bug_url = true; | |
912 | |
913 out.print_raw_cr("#"); | |
914 print_bug_submit_message(&out, _thread); | |
915 } | |
916 | |
917 if (!UseOSErrorReporting) { | |
918 // os::abort() will call abort hooks, try it first. | |
919 static bool skip_os_abort = false; | |
920 if (!skip_os_abort) { | |
921 skip_os_abort = true; | |
922 os::abort(); | |
923 } | |
924 | |
925 // if os::abort() doesn't abort, try os::die(); | |
926 os::die(); | |
927 } | |
928 } | |
929 | |
930 /* | |
931 * OnOutOfMemoryError scripts/commands executed while VM is a safepoint - this | |
932 * ensures utilities such as jmap can observe the process is a consistent state. | |
933 */ | |
934 class VM_ReportJavaOutOfMemory : public VM_Operation { | |
935 private: | |
936 VMError *_err; | |
937 public: | |
938 VM_ReportJavaOutOfMemory(VMError *err) { _err = err; } | |
939 VMOp_Type type() const { return VMOp_ReportJavaOutOfMemory; } | |
940 void doit(); | |
941 }; | |
942 | |
943 void VM_ReportJavaOutOfMemory::doit() { | |
944 // Don't allocate large buffer on stack | |
945 static char buffer[O_BUFLEN]; | |
946 | |
947 tty->print_cr("#"); | |
948 tty->print_cr("# java.lang.OutOfMemoryError: %s", _err->message()); | |
949 tty->print_cr("# -XX:OnOutOfMemoryError=\"%s\"", OnOutOfMemoryError); | |
950 | |
951 // make heap parsability | |
952 Universe::heap()->ensure_parsability(false); // no need to retire TLABs | |
953 | |
954 char* cmd; | |
955 const char* ptr = OnOutOfMemoryError; | |
956 while ((cmd = next_OnError_command(buffer, sizeof(buffer), &ptr)) != NULL){ | |
957 tty->print("# Executing "); | |
958 #if defined(LINUX) | |
959 tty->print ("/bin/sh -c "); | |
960 #elif defined(SOLARIS) | |
961 tty->print ("/usr/bin/sh -c "); | |
962 #endif | |
963 tty->print_cr("\"%s\"...", cmd); | |
964 | |
965 os::fork_and_exec(cmd); | |
966 } | |
967 } | |
968 | |
969 void VMError::report_java_out_of_memory() { | |
970 if (OnOutOfMemoryError && OnOutOfMemoryError[0]) { | |
971 MutexLocker ml(Heap_lock); | |
972 VM_ReportJavaOutOfMemory op(this); | |
973 VMThread::execute(&op); | |
974 } | |
975 } |