Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8245833

crash_with_sigfpe uses pthread_kill(SIGFPE) on macOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 15
    • 15
    • hotspot
    • None
    • b26
    • os_x

    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?");

      Attachments

        Issue Links

          Activity

            People

              gziemski Gerard Ziemski
              gziemski Gerard Ziemski
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: