Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: How to catch and log EXC_BAD_ACCESS?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to catch and log EXC_BAD_ACCESS?



On Jan 26, 2009, at 8:43 PM, Michael Ash wrote:
Actually it's pretty easy to avoid exiting due to EXC_BAD_ACCESS, just
install a signal handler for SIGSEGV.

Of course, doing something rational in such a signal handler is ever
so slightly non-trivial.

Hahahaha.... yeah. That is an understatement.

Before anyone thinks that handling SIGSEGV and recovering from it is a good idea.

It isn't. Don't do it unless you are prepared to invest a TON of time into doing so.

It isn't really even a good idea to try and *emergency save* the user's data.

SIGSEGV (like other such crashes) indicates that something has gone horribly wrong. Most likely, memory corruption has occurred. Thus, if you try to save anything, you will quite likely be saving corrupted data. You better had have a 100% bulletproof means of validating the data post-crash to determine what can be salvaged!!

Of the various projects I have worked on that tried to go down the "we'll detect crashes and recover!" path, every one of them would have achieved a far higher return-on-engineering-investment by focusing on creating working software instead.

b.bum



_______________________________________________

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: 
 >How to catch and log EXC_BAD_ACCESS? (From: Oleg Krupnov <email@hidden>)
 >Re: How to catch and log EXC_BAD_ACCESS? (From: Scott Ribe <email@hidden>)
 >Re: How to catch and log EXC_BAD_ACCESS? (From: Michael Ash <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.