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

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

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Not an Issue
    • Icon: P4 P4
    • tbd
    • 16
    • hotspot

      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
      ...
      }

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

              Created:
              Updated:
              Resolved: