8224793: os::die() does not honor CreateCoredumpOnCrash option

Reviewed-by: kbarrett, dholmes, stuefe
This commit is contained in:
Daniel D. Daugherty 2019-06-05 14:01:01 -04:00
parent c31f5bfa4a
commit 09b642e937
5 changed files with 37 additions and 5 deletions

View file

@ -1206,8 +1206,15 @@ void os::abort(bool dump_core, void* siginfo, const void* context) {
} }
// Die immediately, no exit hook, no abort hook, no cleanup. // Die immediately, no exit hook, no abort hook, no cleanup.
// Dump a core file, if possible, for debugging.
void os::die() { void os::die() {
::abort(); if (TestUnresponsiveErrorHandler && !CreateCoredumpOnCrash) {
// For TimeoutInErrorHandlingTest.java, we just kill the VM
// and don't take the time to generate a core file.
os::signal_raise(SIGKILL);
} else {
::abort();
}
} }
intx os::current_thread_id() { intx os::current_thread_id() {

View file

@ -1073,9 +1073,16 @@ void os::abort(bool dump_core, void* siginfo, const void* context) {
} }
// Die immediately, no exit hook, no abort hook, no cleanup. // Die immediately, no exit hook, no abort hook, no cleanup.
// Dump a core file, if possible, for debugging.
void os::die() { void os::die() {
// _exit() on BsdThreads only kills current thread if (TestUnresponsiveErrorHandler && !CreateCoredumpOnCrash) {
::abort(); // For TimeoutInErrorHandlingTest.java, we just kill the VM
// and don't take the time to generate a core file.
os::signal_raise(SIGKILL);
} else {
// _exit() on BsdThreads only kills current thread
::abort();
}
} }
// Information of current thread in variety of formats // Information of current thread in variety of formats

View file

@ -1461,8 +1461,15 @@ void os::abort(bool dump_core, void* siginfo, const void* context) {
} }
// Die immediately, no exit hook, no abort hook, no cleanup. // Die immediately, no exit hook, no abort hook, no cleanup.
// Dump a core file, if possible, for debugging.
void os::die() { void os::die() {
::abort(); if (TestUnresponsiveErrorHandler && !CreateCoredumpOnCrash) {
// For TimeoutInErrorHandlingTest.java, we just kill the VM
// and don't take the time to generate a core file.
os::signal_raise(SIGKILL);
} else {
::abort();
}
} }
// thread_id is kernel thread id (similar to Solaris LWP id) // thread_id is kernel thread id (similar to Solaris LWP id)

View file

@ -1334,8 +1334,15 @@ void os::abort(bool dump_core, void* siginfo, const void* context) {
} }
// Die immediately, no exit hook, no abort hook, no cleanup. // Die immediately, no exit hook, no abort hook, no cleanup.
// Dump a core file, if possible, for debugging.
void os::die() { void os::die() {
::abort(); // dump core (for debugging) if (TestUnresponsiveErrorHandler && !CreateCoredumpOnCrash) {
// For TimeoutInErrorHandlingTest.java, we just kill the VM
// and don't take the time to generate a core file.
os::signal_raise(SIGKILL);
} else {
::abort();
}
} }
// DLL functions // DLL functions

View file

@ -518,6 +518,10 @@ class os: AllStatic {
static void abort(bool dump_core = true); static void abort(bool dump_core = true);
// Die immediately, no exit hook, no abort hook, no cleanup. // Die immediately, no exit hook, no abort hook, no cleanup.
// Dump a core file, if possible, for debugging. os::abort() is the
// preferred means to abort the VM on error. os::die() should only
// be called if something has gone badly wrong. CreateCoredumpOnCrash
// is intentionally not honored by this function.
static void die(); static void die();
// File i/o operations // File i/o operations