< prev index next >

src/hotspot/os/linux/os_linux.cpp

Print this page




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* siginfo, const void* context) {
1517   os::shutdown();
1518   if (dump_core) {
1519     if (DumpPrivateMappingsInCore) {
1520       ClassLoader::close_jrt_image();
1521     }
1522 #ifndef PRODUCT
1523     fdStream out(defaultStream::output_fd());
1524     out.print_raw("Current thread is ");
1525     char buf[16];
1526     jio_snprintf(buf, sizeof(buf), UINTX_FORMAT, os::current_thread_id());
1527     out.print_raw_cr(buf);
1528     out.print_raw_cr("Dumping core ...");
1529 #endif
1530     ::abort(); // dump core
1531   }
1532 
1533   ::exit(1);
1534 }
1535 
1536 // Die immediately, no exit hook, no abort hook, no cleanup.
1537 // Dump a core file, if possible, for debugging.
1538 void os::die() {
1539   if (TestUnresponsiveErrorHandler && !CreateCoredumpOnCrash) {
1540     // For TimeoutInErrorHandlingTest.java, we just kill the VM
1541     // and don't take the time to generate a core file.
1542     os::signal_raise(SIGKILL);
1543   } else {
1544     ::abort();
1545   }
1546 }
1547 
1548 // thread_id is kernel thread id (similar to Solaris LWP id)
1549 intx os::current_thread_id() { return os::Linux::gettid(); }




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* siginfo, const void* context) {
1517   os::shutdown();
1518   if (dump_core) {
1519     if (DumpPrivateMappingsInCore) {
1520       ClassLoader::close_jrt_image();
1521     }








1522     ::abort(); // dump core
1523   }
1524 
1525   ::exit(1);
1526 }
1527 
1528 // Die immediately, no exit hook, no abort hook, no cleanup.
1529 // Dump a core file, if possible, for debugging.
1530 void os::die() {
1531   if (TestUnresponsiveErrorHandler && !CreateCoredumpOnCrash) {
1532     // For TimeoutInErrorHandlingTest.java, we just kill the VM
1533     // and don't take the time to generate a core file.
1534     os::signal_raise(SIGKILL);
1535   } else {
1536     ::abort();
1537   }
1538 }
1539 
1540 // thread_id is kernel thread id (similar to Solaris LWP id)
1541 intx os::current_thread_id() { return os::Linux::gettid(); }


< prev index next >