Re: Catching Cocoa application Crash
Re: Catching Cocoa application Crash
- Subject: Re: Catching Cocoa application Crash
- From: Bill Garrison <email@hidden>
- Date: Fri, 8 Feb 2008 11:30:52 -0500
On Feb 8, 2008, at 8:04 AM, parag vibhute wrote:
I thought about the signal handler but not sure that any of those 30
signals
which man page of signal() mentions always get called on application
crash.
I just spent some time writing crash detection code. You can count on
a signal being sent if the application's process terminates
unexpectedly. Either one of SIGBUS and SIGSEGV will be sent in most
of crashes, but you could definitely see these other signals depending
on the crash condition: SIGFPE, SIGILL, SIGEMT, SIGSYS.
You may also want to implement the NSExceptionHandler's -
exceptionHandler:shouldLogException:mask: delegate to catch exceptions
that might also warrant terminating the app.
Exceptions that aren't handled internally will eventually propagate to
the NSApplication object as "unhandled" exceptions. Implementing -
exceptionHandler:shouldLogException:mask: (or
shouldHandleException:mask:) gives you an opportunity to catch those
events and take an action.
I found this Jose Cruz O'Reilly article helpful in learning about
exception handling:
<http://www.macdevcenter.com/pub/a/mac/2007/07/31/understanding-exceptions-and-handlers-in-cocoa.html
>
Bill
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden