src/os/linux/vm/os_linux.cpp

Print this page




1496   // allow PerfMemory to attempt cleanup of any persistent resources
1497   perfMemory_exit();
1498 
1499   // needs to remove object in file system
1500   AttachListener::abort();
1501 
1502   // flush buffered output, finish log files
1503   ostream_abort();
1504 
1505   // Check for abort hook
1506   abort_hook_t abort_hook = Arguments::abort_hook();
1507   if (abort_hook != NULL) {
1508     abort_hook();
1509   }
1510 
1511 }
1512 
1513 // Note: os::abort() might be called very early during initialization, or
1514 // called from signal handler. Before adding something to os::abort(), make
1515 // sure it is async-safe and can handle partially initialized VM.
1516 void os::abort(bool dump_core) {
1517   os::shutdown();
1518   if (dump_core) {
1519 #ifndef PRODUCT
1520     fdStream out(defaultStream::output_fd());
1521     out.print_raw("Current thread is ");
1522     char buf[16];
1523     jio_snprintf(buf, sizeof(buf), UINTX_FORMAT, os::current_thread_id());
1524     out.print_raw_cr(buf);
1525     out.print_raw_cr("Dumping core ...");
1526 #endif
1527     ::abort(); // dump core
1528   }
1529 
1530   ::exit(1);
1531 }
1532 
1533 // Die immediately, no exit hook, no abort hook, no cleanup.
1534 void os::die() {
1535   // _exit() on LinuxThreads only kills current thread
1536   ::abort();




1496   // allow PerfMemory to attempt cleanup of any persistent resources
1497   perfMemory_exit();
1498 
1499   // needs to remove object in file system
1500   AttachListener::abort();
1501 
1502   // flush buffered output, finish log files
1503   ostream_abort();
1504 
1505   // Check for abort hook
1506   abort_hook_t abort_hook = Arguments::abort_hook();
1507   if (abort_hook != NULL) {
1508     abort_hook();
1509   }
1510 
1511 }
1512 
1513 // Note: os::abort() might be called very early during initialization, or
1514 // called from signal handler. Before adding something to os::abort(), make
1515 // sure it is async-safe and can handle partially initialized VM.
1516 void os::abort(bool dump_core, void* exceptionRecord, void* contextRecord) {
1517   os::shutdown();
1518   if (dump_core) {
1519 #ifndef PRODUCT
1520     fdStream out(defaultStream::output_fd());
1521     out.print_raw("Current thread is ");
1522     char buf[16];
1523     jio_snprintf(buf, sizeof(buf), UINTX_FORMAT, os::current_thread_id());
1524     out.print_raw_cr(buf);
1525     out.print_raw_cr("Dumping core ...");
1526 #endif
1527     ::abort(); // dump core
1528   }
1529 
1530   ::exit(1);
1531 }
1532 
1533 // Die immediately, no exit hook, no abort hook, no cleanup.
1534 void os::die() {
1535   // _exit() on LinuxThreads only kills current thread
1536   ::abort();