< prev index next >

src/hotspot/os/bsd/os_bsd.cpp

Print this page




1039   // needs to remove object in file system
1040   AttachListener::abort();
1041 
1042   // flush buffered output, finish log files
1043   ostream_abort();
1044 
1045   // Check for abort hook
1046   abort_hook_t abort_hook = Arguments::abort_hook();
1047   if (abort_hook != NULL) {
1048     abort_hook();
1049   }
1050 
1051 }
1052 
1053 // Note: os::abort() might be called very early during initialization, or
1054 // called from signal handler. Before adding something to os::abort(), make
1055 // sure it is async-safe and can handle partially initialized VM.
1056 void os::abort(bool dump_core, void* siginfo, const void* context) {
1057   os::shutdown();
1058   if (dump_core) {
1059 #ifndef PRODUCT
1060     fdStream out(defaultStream::output_fd());
1061     out.print_raw("Current thread is ");
1062     char buf[16];
1063     jio_snprintf(buf, sizeof(buf), UINTX_FORMAT, os::current_thread_id());
1064     out.print_raw_cr(buf);
1065     out.print_raw_cr("Dumping core ...");
1066 #endif
1067     ::abort(); // dump core
1068   }
1069 
1070   ::exit(1);
1071 }
1072 
1073 // Die immediately, no exit hook, no abort hook, no cleanup.
1074 // Dump a core file, if possible, for debugging.
1075 void os::die() {
1076   if (TestUnresponsiveErrorHandler && !CreateCoredumpOnCrash) {
1077     // For TimeoutInErrorHandlingTest.java, we just kill the VM
1078     // and don't take the time to generate a core file.
1079     os::signal_raise(SIGKILL);
1080   } else {
1081     // _exit() on BsdThreads only kills current thread
1082     ::abort();
1083   }
1084 }
1085 
1086 // Information of current thread in variety of formats




1039   // needs to remove object in file system
1040   AttachListener::abort();
1041 
1042   // flush buffered output, finish log files
1043   ostream_abort();
1044 
1045   // Check for abort hook
1046   abort_hook_t abort_hook = Arguments::abort_hook();
1047   if (abort_hook != NULL) {
1048     abort_hook();
1049   }
1050 
1051 }
1052 
1053 // Note: os::abort() might be called very early during initialization, or
1054 // called from signal handler. Before adding something to os::abort(), make
1055 // sure it is async-safe and can handle partially initialized VM.
1056 void os::abort(bool dump_core, void* siginfo, const void* context) {
1057   os::shutdown();
1058   if (dump_core) {








1059     ::abort(); // dump core
1060   }
1061 
1062   ::exit(1);
1063 }
1064 
1065 // Die immediately, no exit hook, no abort hook, no cleanup.
1066 // Dump a core file, if possible, for debugging.
1067 void os::die() {
1068   if (TestUnresponsiveErrorHandler && !CreateCoredumpOnCrash) {
1069     // For TimeoutInErrorHandlingTest.java, we just kill the VM
1070     // and don't take the time to generate a core file.
1071     os::signal_raise(SIGKILL);
1072   } else {
1073     // _exit() on BsdThreads only kills current thread
1074     ::abort();
1075   }
1076 }
1077 
1078 // Information of current thread in variety of formats


< prev index next >