JDK-8245833 : crash_with_sigfpe uses pthread_kill(SIGFPE) on macOS
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 15
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • Submitted: 2020-05-26
  • Updated: 2024-10-17
  • Resolved: 2020-06-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 15
15 b26Fixed
Related Reports
Blocks :  
Relates :  
Description
crash_with_sigfpe() currently uses this code:

volatile int x = 0;
volatile int y = 1/x;

which does NOT cause SIGFPE on macOS (due to clang compiler optimizing it out?), so it has to fallback to using pthread_kill(SIGFPE).

However, we CAN cause SIGFPE on macOS with this code:

volatile int sigfpe_int = 0;
static void crash_with_sigfpe() {
  sigfpe_int = sigfpe_int/sigfpe_int;
}

and then we don't have to fallback to pthread_kill(SIGFPE). The new code works as expected on Linux too.

Also, since the suggested code causes real crash, as opposed to it being simulated by pthread_kill(), 8237727 works just fine for "java -XX:ErrorHandlerTest=15" test case.

Otherwise, since currently it's not real SIGFPE, 8237727 causes the code to continue running without re-crashing (which we expect) and we trigger:

  tty->print_cr("VMError::controlled_crash: survived intentional crash. Did you suppress the assert?");

Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/fd2e58901ebf User: gziemski Date: 2020-06-02 18:15:50 +0000
02-06-2020