Re: Uncaught exceptions not terminating my app
Re: Uncaught exceptions not terminating my app
- Subject: Re: Uncaught exceptions not terminating my app
- From: "Paul Sanders" <email@hidden>
- Date: Thu, 28 Jan 2010 17:53:02 -0000
----- Original Message -----
From: "Jens Alfke" <email@hidden>
To: "Paul Sanders" <email@hidden>
Cc: "Ken Thomases" <email@hidden>; <email@hidden>
Sent: Thursday, January 28, 2010 4:34 PM
Subject: Re: Uncaught exceptions not terminating my app
On Jan 28, 2010, at 12:10 AM, Paul Sanders wrote:
>> If you don't crash the app, you don't get the stack trace. No
>> stack trace = no clue about what went wrong.
> That's why I said the error alert should include the same "Report" button as the crash
> report would.
A symbolic stack trace is only available on Snow Leopard. We also support Leopard and Tiger. And a numeric stack trace can only be interpreted if you have the slides of the loaded dylibs. I don't know how to get hold of those at runtime ...
>> And we do offer to
>> save the user's work (in the NSExceptionHandler delegate) before
>> we bail out.
>That's fairly dangerous. At that point you have no idea what's on the stack or what >operations are halfway done. If you're doing inside a half-completed AppKit or HLTB call, >putting up any UI creates re-entrant calls. If you're inside your own code, you're calling >yourself re-entrantly when you save.
>It's safer to save away the exception info, let the stack unwind fully, and then on the next >runloop cycle put up the alert:
>http://bitbucket.org/snej/myutilities/src/tip/ExceptionUtils.m
No more dangerous then doing a random longjmp back to the event loop, which is what happens if you let the exception unwind. As I say, the frameworks do not appear to use exception handling internally, other than to get back to the event loop in this way. If they did, what I am doing would be a disaster.
Thanks for the link but it is out of date. atos is no longer supplied in the retail distribution, as of Leopard. Madness, no? But as Scott already pointed out, Snow Leopard's [NSException callStackSymbols] method offers a viable alternative for reporting a complete symbolic stack trace yourself if your app is Snow Leopard only, so if you are philosophically opposed to crashing your app when something bad has happened (which I am not) then that might be preferable.
_______________________________________________
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