Re: can I catch an EXC_BAD_ACCESS?
Re: can I catch an EXC_BAD_ACCESS?
- Subject: Re: can I catch an EXC_BAD_ACCESS?
- From: Cyrus Harmon <email@hidden>
- Date: Sat, 24 Jun 2006 16:13:46 -0700
Or, the EXC_BAD_ACCESS/SIGBUS might signal a memory protection
violation, which might very well be the intended behavior of the
program in question. One can write a mach exception handler to handle
the EXC_BAD_ACCESS or, a bit more easily, a POSIX-style (often
referred to as a BSD-style) signal handler to handle the SIGBUS. But
then you'll run into problems trying to debug this because gdb
doesn't properly step over them, or ignore them if trying to do
handle pass noprint. It would be nice if Apple would unbreak gdb such
that one could debug programs that rely on functioning memory
protection as part of their strategy for handling memory management.
Cyrus
On Jun 24, 2006, at 12:45 PM, Cameron Hayne wrote:
On 24-Jun-06, at 1:20 PM, Matt Neuburg wrote:
Under certain conditions (out of my control) my app gets an
EXC_BAD_ACCESS.
I know where this is happening and have wrapped that part of the
code in a
@try/@catch but it doesn't help: the program stops dead and the
@catch stuff
never runs. Is there a way to catch this sort of thing?
EXC_BAD_ACCESS usually indicates a programming error and thus it
isn't something that you usually want to just catch and gloss over.
I would recommend fixing the problem instead. Supply details of why
this is happening in your code and why you can't fix it and maybe
we can help suggest something.
But I think that EXC_BAD_ACCESS will result in a SIGBUS signal. If
so, you could set up a signal handler for SIGBUS and do something
appropriate. See my sample project "TestSignals" (http://hayne.net/
MacDev/TestSignals/) for how to do this and cautions on what is
appropriate in a signal handler.
--
Cameron Hayne
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40bobobeach.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden