Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Commit

Permalink
8259392: Zero error reporting is broken after JDK-8255711
Browse files Browse the repository at this point in the history
Backport-of: bb247b02c82b5b74a3b3a1ce76075e5d109829e1
  • Loading branch information
shipilev committed Mar 2, 2021
1 parent 6198e0c commit bb285ce
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions src/hotspot/os/posix/signals_posix.cpp
Expand Up @@ -578,26 +578,22 @@ int JVM_HANDLE_XXX_SIGNAL(int sig, siginfo_t* info,
// prepare fault pc address for error reporting.
if (S390_ONLY(sig == SIGILL || sig == SIGFPE) NOT_S390(false)) {
pc = (address)info->si_addr;
} else if (ZERO_ONLY(true) NOT_ZERO(false)) {
// Non-arch-specific Zero code does not really know the pc.
// This can be alleviated by making arch-specific os::Posix::ucontext_get_pc
// available for Zero for known architectures. But for generic Zero
// code, it would still remain unknown.
pc = NULL;
} else {
pc = os::Posix::ucontext_get_pc(uc);
}
}
#if defined(ZERO) && !defined(PRODUCT)
char buf[64];
VMError::report_and_die(t, sig, pc, info, ucVoid,
"\n#"
"\n# /--------------------\\"
"\n# | %-7s |"
"\n# \\---\\ /--------------/"
"\n# /"
"\n# [-] |\\_/| "
"\n# (+)=C |o o|__ "
"\n# | | =-*-=__\\ "
"\n# OOO c_c_(___)",
get_signal_name(sig, buf, sizeof(buf)));
#else
VMError::report_and_die(t, sig, pc, info, ucVoid);
#endif
// For Zero, we ignore the crash context, because:
// a) The crash would be in C++ interpreter code, so context is not really relevant;
// b) Generic Zero code would not be able to parse it, so when generic error
// reporting code asks e.g. about frames on stack, Zero would experience
// a secondary ShouldNotCallThis() crash.
VMError::report_and_die(t, sig, pc, info, NOT_ZERO(ucVoid) ZERO_ONLY(NULL));
// VMError should not return.
ShouldNotReachHere();
}
Expand Down

1 comment on commit bb285ce

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.