mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 17:44:40 +02:00
8219584: Try to dump error file by thread which causes safepoint timeout
Reviewed-by: stuefe, dholmes, kvn
This commit is contained in:
parent
cafb914cca
commit
97ec4aeed2
7 changed files with 151 additions and 3 deletions
|
@ -902,6 +902,16 @@ void SafepointSynchronize::print_safepoint_timeout() {
|
|||
// To debug the long safepoint, specify both AbortVMOnSafepointTimeout &
|
||||
// ShowMessageBoxOnError.
|
||||
if (AbortVMOnSafepointTimeout) {
|
||||
// Send the blocking thread a signal to terminate and write an error file.
|
||||
for (JavaThreadIteratorWithHandle jtiwh; JavaThread *cur_thread = jtiwh.next(); ) {
|
||||
if (cur_thread->safepoint_state()->is_running()) {
|
||||
if (!os::signal_thread(cur_thread, SIGILL, "blocking a safepoint")) {
|
||||
break; // Could not send signal. Report fatal error.
|
||||
}
|
||||
// Give cur_thread a chance to report the error and terminate the VM.
|
||||
os::sleep(Thread::current(), 3000, false);
|
||||
}
|
||||
}
|
||||
fatal("Safepoint sync time longer than " INTX_FORMAT "ms detected when executing %s.",
|
||||
SafepointTimeoutDelay, VMThread::vm_operation()->name());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue