提交 75ab2d06 编写于 作者: C coleenp

8004124: Handle and/or warn about SI_KERNEL

Summary: Detect this crash in the signal handler and give a fatal error message instead of making us chase down bugs that don't reproduce
Reviewed-by: kvn, mgerdin, dholmes
上级 47a90e68
...@@ -289,6 +289,16 @@ JVM_handle_linux_signal(int sig, ...@@ -289,6 +289,16 @@ JVM_handle_linux_signal(int sig,
} }
#endif // AMD64 #endif // AMD64
#ifndef AMD64
// Halt if SI_KERNEL before more crashes get misdiagnosed as Java bugs
// This can happen in any running code (currently more frequently in
// interpreter code but has been seen in compiled code)
if (sig == SIGSEGV && info->si_addr == 0 && info->si_code == SI_KERNEL) {
fatal("An irrecoverable SI_KERNEL SIGSEGV has occurred due "
"to unstable signal handling in this distribution.");
}
#endif // AMD64
// Handle ALL stack overflow variations here // Handle ALL stack overflow variations here
if (sig == SIGSEGV) { if (sig == SIGSEGV) {
address addr = (address) info->si_addr; address addr = (address) info->si_addr;
......
...@@ -813,8 +813,11 @@ address SharedRuntime::continuation_for_implicit_exception(JavaThread* thread, ...@@ -813,8 +813,11 @@ address SharedRuntime::continuation_for_implicit_exception(JavaThread* thread,
// 3. Implict null exception in nmethod // 3. Implict null exception in nmethod
if (!cb->is_nmethod()) { if (!cb->is_nmethod()) {
guarantee(cb->is_adapter_blob() || cb->is_method_handles_adapter_blob(), bool is_in_blob = cb->is_adapter_blob() || cb->is_method_handles_adapter_blob();
"exception happened outside interpreter, nmethods and vtable stubs (1)"); if (!is_in_blob) {
cb->print();
fatal(err_msg("exception happened outside interpreter, nmethods and vtable stubs at pc " INTPTR_FORMAT, pc));
}
Events::log_exception(thread, "NullPointerException in code blob at " INTPTR_FORMAT, pc); Events::log_exception(thread, "NullPointerException in code blob at " INTPTR_FORMAT, pc);
// There is no handler here, so we will simply unwind. // There is no handler here, so we will simply unwind.
return StubRoutines::throw_NullPointerException_at_call_entry(); return StubRoutines::throw_NullPointerException_at_call_entry();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册