• 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: "parag vibhute" <email@hidden>
  • Date: Mon, 25 Feb 2008 12:44:41 +0530

Hi Bill,

Sorry for late reply.

As you suggested, I have implemented signal handling mechanism to trap the
"application crash" & it is working fine. Thanks.

I have one more problem. I am using Tiger OS. Suppose user quits the
application by using "Force Quit" option from activity monitor then since it
sends "kill" signal, I can not catch that signal. So in this case, what will
you suggest? (I noticed that if user pops up "Force quit" window by pressing
ctrl+option+Esc & force quits the application from there, then it sends
"SIGTERM" signal which can be caught but can't catch force quit from the
activity monitor)

Thanks,
Palav


On Fri, Feb 8, 2008 at 10:00 PM, Bill Garrison <email@hidden>
wrote:

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


--

There are many things in your life that will catch your eye but only a few
will catch your heart....pursue those'.
_______________________________________________

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

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>)
 >Re: Catching Cocoa application Crash (From: Bill Garrison <email@hidden>)

  • Prev by Date: Garbage Collection makes my app look fat
  • Next by Date: Custom NSView and tooltips...
  • Previous by thread: Re: Catching Cocoa application Crash
  • Next by thread: Re: Catching Cocoa application Crash
  • Index(es):
    • Date
    • Thread