Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8263603: Remove leftovers of "FPE_FLT..." type signals from regular signal handling code #3175

Draft
wants to merge 3 commits into
base: master
from
Draft
Changes from all commits
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

@@ -453,11 +453,11 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
else

#ifdef AMD64
if (sig == SIGFPE &&
(info->si_code == FPE_INTDIV || info->si_code == FPE_FLTDIV
if (sig == SIGFPE &&
(info->si_code == FPE_INTDIV
// Workaround for macOS ARM incorrectly reporting FPE_FLTINV for "div by 0"
// instead of the expected FPE_FLTDIV when running x86_64 binary under Rosetta emulation
MACOS_ONLY(|| (VM_Version::is_cpu_emulated() && info->si_code == FPE_FLTINV)))) {
MACOS_ONLY(|| (info->si_code == FPE_FLTINV && VM_Version::is_cpu_emulated())))) {
stub =
SharedRuntime::
continuation_for_implicit_exception(thread,
@@ -486,6 +486,11 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
}
#endif /* __APPLE__ */

} else if (sig == SIGFPE &&
(info->si_code >= FPE_FLTDIV && info->si_code <= FPE_FLTSUB)) {
tty->print_cr("\nUnexpected si_code %d (of type FPE_FLT...) with SIGFPE.\n", info->si_code);
assert(false, "Unexpected FPE_FLT signal, this is probably a bug in the OS");

#else
if (sig == SIGFPE /* && info->si_code == FPE_INTDIV */) {
// HACK: si_code does not work on bsd 2.2.12-20!!!
@@ -249,14 +249,17 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
}
else

if (sig == SIGFPE &&
(info->si_code == FPE_INTDIV || info->si_code == FPE_FLTDIV)) {
if (sig == SIGFPE && info->si_code == FPE_INTDIV) {
stub =
SharedRuntime::
continuation_for_implicit_exception(thread,
pc,
SharedRuntime::
IMPLICIT_DIVIDE_BY_ZERO);
} else if (sig == SIGFPE &&
(info->si_code >= FPE_FLTDIV && info->si_code <= FPE_FLTSUB)) {
tty->print_cr("\nUnexpected si_code %d (of type FPE_FLT...) with SIGFPE.\n", info->si_code);
assert(false, "Unexpected FPE_FLT signal, this is probably a bug in the OS");
} else if (sig == SIGSEGV &&
MacroAssembler::uses_implicit_null_check((void*)addr)) {
// Determination of interpreter/vtable stub/compiled code null exception
@@ -271,14 +271,17 @@ bool PosixSignals::pd_hotspot_signal_handler(int sig, siginfo_t* info,
else

#ifdef AMD64
if (sig == SIGFPE &&
(info->si_code == FPE_INTDIV || info->si_code == FPE_FLTDIV)) {
if (sig == SIGFPE && info->si_code == FPE_INTDIV) {
stub =
SharedRuntime::
continuation_for_implicit_exception(thread,
pc,
SharedRuntime::
IMPLICIT_DIVIDE_BY_ZERO);
} else if (sig == SIGFPE &&
(info->si_code >= FPE_FLTDIV && info->si_code <= FPE_FLTSUB)) {
tty->print_cr("\nUnexpected si_code %d (of type FPE_FLT...) with SIGFPE.\n", info->si_code);
assert(false, "Unexpected FPE_FLT signal, this is probably a bug in the OS");
#else
if (sig == SIGFPE /* && info->si_code == FPE_INTDIV */) {
// HACK: si_code does not work on linux 2.2.12-20!!!
ProTip! Use n and p to navigate between commits in a pull request.