1207
1208 // allow PerfMemory to attempt cleanup of any persistent resources
1209 perfMemory_exit();
1210
1211 // needs to remove object in file system
1212 AttachListener::abort();
1213
1214 // flush buffered output, finish log files
1215 ostream_abort();
1216
1217 // Check for abort hook
1218 abort_hook_t abort_hook = Arguments::abort_hook();
1219 if (abort_hook != NULL) {
1220 abort_hook();
1221 }
1222 }
1223
1224 // Note: os::abort() might be called very early during initialization, or
1225 // called from signal handler. Before adding something to os::abort(), make
1226 // sure it is async-safe and can handle partially initialized VM.
1227 void os::abort(bool dump_core) {
1228 os::shutdown();
1229 if (dump_core) {
1230 #ifndef PRODUCT
1231 fdStream out(defaultStream::output_fd());
1232 out.print_raw("Current thread is ");
1233 char buf[16];
1234 jio_snprintf(buf, sizeof(buf), UINTX_FORMAT, os::current_thread_id());
1235 out.print_raw_cr(buf);
1236 out.print_raw_cr("Dumping core ...");
1237 #endif
1238 ::abort(); // dump core
1239 }
1240
1241 ::exit(1);
1242 }
1243
1244 // Die immediately, no exit hook, no abort hook, no cleanup.
1245 void os::die() {
1246 ::abort();
1247 }
|
1207
1208 // allow PerfMemory to attempt cleanup of any persistent resources
1209 perfMemory_exit();
1210
1211 // needs to remove object in file system
1212 AttachListener::abort();
1213
1214 // flush buffered output, finish log files
1215 ostream_abort();
1216
1217 // Check for abort hook
1218 abort_hook_t abort_hook = Arguments::abort_hook();
1219 if (abort_hook != NULL) {
1220 abort_hook();
1221 }
1222 }
1223
1224 // Note: os::abort() might be called very early during initialization, or
1225 // called from signal handler. Before adding something to os::abort(), make
1226 // sure it is async-safe and can handle partially initialized VM.
1227 void os::abort(bool dump_core, void* siginfo, void* context) {
1228 os::shutdown();
1229 if (dump_core) {
1230 #ifndef PRODUCT
1231 fdStream out(defaultStream::output_fd());
1232 out.print_raw("Current thread is ");
1233 char buf[16];
1234 jio_snprintf(buf, sizeof(buf), UINTX_FORMAT, os::current_thread_id());
1235 out.print_raw_cr(buf);
1236 out.print_raw_cr("Dumping core ...");
1237 #endif
1238 ::abort(); // dump core
1239 }
1240
1241 ::exit(1);
1242 }
1243
1244 // Die immediately, no exit hook, no abort hook, no cleanup.
1245 void os::die() {
1246 ::abort();
1247 }
|