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

macOS: remove 10.4 workaround from os::Bsd::install_signal_handlers

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 16
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Labels:

      Description

      void os::Bsd::install_signal_handlers() {
      ...
      #if defined(__APPLE__)
          // In Mac OS X 10.4, CrashReporter will write a crash log for all 'fatal' signals, including
          // signals caught and handled by the JVM. To work around this, we reset the mach task
          // signal handler that's placed on our process by CrashReporter. This disables
          // CrashReporter-based reporting.
          //
          // This work-around is not necessary for 10.5+, as CrashReporter no longer intercedes
          // on caught fatal signals.
          //
          // Additionally, gdb installs both standard BSD signal handlers, and mach exception
          // handlers. By replacing the existing task exception handler, we disable gdb's mach
          // exception handling, while leaving the standard BSD signal handlers functional.
          kern_return_t kr;
          kr = task_set_exception_ports(mach_task_self(),
                                        EXC_MASK_BAD_ACCESS | EXC_MASK_ARITHMETIC,
                                        MACH_PORT_NULL,
                                        EXCEPTION_STATE_IDENTITY,
                                        MACHINE_THREAD_STATE);

          assert(kr == KERN_SUCCESS, "could not set mach task signal handler");
      #endif
      ...
      }

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated: