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