• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Catching Cocoa application Crash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Catching Cocoa application Crash
      • From: "parag vibhute" <email@hidden>
References: 
 >Catching Cocoa application Crash (From: "parag vibhute" <email@hidden>)
 >Re: Catching Cocoa application Crash (From: "Apparao Mulpuri" <email@hidden>)
 >Re: Catching Cocoa application Crash (From: "parag vibhute" <email@hidden>)

  • Prev by Date: Re: Using iChat Theater
  • Next by Date: Re: Hanging NSTextView with a paste
  • Previous by thread: Re: Catching Cocoa application Crash
  • Next by thread: Re: Catching Cocoa application Crash
  • Index(es):
    • Date
    • Thread