Re: CrashReporter, signals and exception ports
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com User-agent: Mozilla Thunderbird 1.0.7 (Macintosh/20050923) We do this just with a signal handler. We catch: static int signals[] = { SIGALRM, SIGBUS, SIGFPE, SIGHUP, SIGILL, SIGINT, SIGABRT, SIGQUIT, SIGSEGV, SIGTRAP, SIGTERM, SIGVTALRM, SIGXCPU, SIGXFSZ, #if defined(HAVE_DECL_SIGPWR) && HAVE_DECL_SIGPWR SIGPWR, #endif -1 }; And then we set up the signal handlers using: struct sigaction sa; sa.sa_flags = 0; if( p != NULL ) sa.sa_flags |= SA_ONSTACK; sa.sa_flags |= SA_NODEFER; sa.sa_flags |= SA_SIGINFO; sigemptyset(&sa.sa_mask); /* Set up our signal handlers. */ sa.sa_sigaction = SigHandler; for( int i = 0; signals[i] != -1; ++i ) sigaction( signals[i], &sa, NULL ); [snip] Thanks for the pointer, I'll investigate it. Jean-Francois Im _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... Steve Checkoway wrote: where p is the pointer to our signal stack set up with sigaltstack. Doing this we can shut down the full screen graphics context and perform any other clean up. We actually give a stack trace (among other things) ourself and setting the handlers seems to prevent the Crash Reporter from running. We didn't have to do anything with exception ports to get this to work. Aha! Reading the CrashReporter documentation seems to hint that setting a signal handler using signal(3) doesn't work. This email sent to site_archiver@lists.apple.com
participants (1)
-
Jean-Francois Im