Question

I am unable to post images as I don't yet have 10 rep so my apologies if any of this is vague.

I'm writing an ARC application for Mac OS X and it throws an EXC_BAD_ACCESS error. In an attempt to track down the issue, I have enabled Zombie Objects under the 'Diagnostics' Tab.

I then startup Instruments (Zombies)

Finally I record and cause the app to crash and the error is generated. However, instead of getting any zombie indicators in instruments, I get an app problem report for my app that I'm profiling saying that my app 'quit unexpectedly'. No stack trace is produced for me to navigate and that problem report isn't of much use to me.

Could the EXC_BAD_ACCESS error be caused by something other than dereferencing a pointer to memory that has been released? Should I always expect to get Zombies in this case when there is an EXC_BAD_ACCESS error? If so then how can I see the zombie? What else do I need to configure to get the zombies?

Thanks

Was it helpful?

Solution

Could the EXC_BAD_ACCESS error be caused by something other than dereferencing a pointer to memory that has been released?

Yes. That error simply means that your program tried to dereference a pointer that refers to a location that your program isn't allowed to access. That could be because it points to an object that no longer exists, but it can also happen when you use a pointer without setting it to something valid in the first place, or when you incorrectly try to use a non-pointer value as a pointer.

Should I always expect to get Zombies in this case when there is an EXC_BAD_ACCESS error?

No, NSZombieEnabled only helps you find cases where you're trying to access a deallocated object. It won't help you with other cases that produce EXC_BAD_ACCESS.

OTHER TIPS

You could try adding an exception breakpoint in Xcode.

  1. Click the "Breakpoint navigator" tab in Xcode

  2. Click the plus sign

  3. Click "Add Exception Breakpoint"

    Exception breakpoint

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top