hotspot/src/share/vm/utilities/vmError.cpp
changeset 30240 a7ba42fa1df6
parent 30125 8ba6e8e367e9
child 30241 4cf8974e0d20
equal deleted inserted replaced
30239:dc83236ebb28 30240:a7ba42fa1df6
   215 }
   215 }
   216 
   216 
   217 bool VMError::coredump_status;
   217 bool VMError::coredump_status;
   218 char VMError::coredump_message[O_BUFLEN];
   218 char VMError::coredump_message[O_BUFLEN];
   219 
   219 
   220 void VMError::report_coredump_status(const char* message, bool status) {
   220 void VMError::record_coredump_status(const char* message, bool status) {
   221   coredump_status = status;
   221   coredump_status = status;
   222   strncpy(coredump_message, message, sizeof(coredump_message));
   222   strncpy(coredump_message, message, sizeof(coredump_message));
   223   coredump_message[sizeof(coredump_message)-1] = 0;
   223   coredump_message[sizeof(coredump_message)-1] = 0;
   224 }
   224 }
   225 
   225 
   523        st->cr();
   523        st->cr();
   524        st->print_cr("#");
   524        st->print_cr("#");
   525      }
   525      }
   526   STEP(63, "(printing core file information)")
   526   STEP(63, "(printing core file information)")
   527     st->print("# ");
   527     st->print("# ");
   528     if (coredump_status) {
   528     if (CreateCoredumpOnCrash) {
   529       st->print("Core dump written. Default location: %s", coredump_message);
   529       if (coredump_status) {
       
   530         st->print("Core dump will be written. %s", coredump_message);
       
   531       } else {
       
   532         st->print("No core dump will be written. %s", coredump_message);
       
   533       }
   530     } else {
   534     } else {
   531       st->print("Failed to write core dump. %s", coredump_message);
   535       st->print("CreateCoredumpOnCrash turned off, no core file dumped");
   532     }
   536     }
   533     st->cr();
   537     st->cr();
   534     st->print_cr("#");
   538     st->print_cr("#");
   535 
   539 
   536   STEP(65, "(printing bug submit message)")
   540   STEP(65, "(printing bug submit message)")
   916   static bool out_done = false;         // done printing to standard out
   920   static bool out_done = false;         // done printing to standard out
   917   static bool log_done = false;         // done saving error log
   921   static bool log_done = false;         // done saving error log
   918   static bool transmit_report_done = false; // done error reporting
   922   static bool transmit_report_done = false; // done error reporting
   919 
   923 
   920   if (SuppressFatalErrorMessage) {
   924   if (SuppressFatalErrorMessage) {
   921       os::abort();
   925       os::abort(CreateCoredumpOnCrash);
   922   }
   926   }
   923   jlong mytid = os::current_thread_id();
   927   jlong mytid = os::current_thread_id();
   924   if (first_error == NULL &&
   928   if (first_error == NULL &&
   925       Atomic::cmpxchg_ptr(this, &first_error, NULL) == NULL) {
   929       Atomic::cmpxchg_ptr(this, &first_error, NULL) == NULL) {
   926 
   930 
   934       // User has asked JVM to abort. Reset ShowMessageBoxOnError so the
   938       // User has asked JVM to abort. Reset ShowMessageBoxOnError so the
   935       // WatcherThread can kill JVM if the error handler hangs.
   939       // WatcherThread can kill JVM if the error handler hangs.
   936       ShowMessageBoxOnError = false;
   940       ShowMessageBoxOnError = false;
   937     }
   941     }
   938 
   942 
   939     // Write a minidump on Windows, check core dump limits on Linux/Solaris
   943     os::check_dump_limit(buffer, sizeof(buffer));
   940     os::check_or_create_dump(_siginfo, _context, buffer, sizeof(buffer));
       
   941 
   944 
   942     // reset signal handlers or exception filter; make sure recursive crashes
   945     // reset signal handlers or exception filter; make sure recursive crashes
   943     // are handled properly.
   946     // are handled properly.
   944     reset_signal_handlers();
   947     reset_signal_handlers();
   945 
   948 
  1106     // os::abort() will call abort hooks, try it first.
  1109     // os::abort() will call abort hooks, try it first.
  1107     static bool skip_os_abort = false;
  1110     static bool skip_os_abort = false;
  1108     if (!skip_os_abort) {
  1111     if (!skip_os_abort) {
  1109       skip_os_abort = true;
  1112       skip_os_abort = true;
  1110       bool dump_core = should_report_bug(first_error->_id);
  1113       bool dump_core = should_report_bug(first_error->_id);
  1111       os::abort(dump_core);
  1114       os::abort(dump_core && CreateCoredumpOnCrash, _siginfo, _context);
  1112     }
  1115     }
  1113 
  1116 
  1114     // if os::abort() doesn't abort, try os::die();
  1117     // if os::abort() doesn't abort, try os::die();
  1115     os::die();
  1118     os::die();
  1116   }
  1119   }