Skip navigation.
 
mlRe: How to find EXC_BAD_ACCESS bug?
FROM : Steve Sims
DATE : Wed Aug 25 01:06:09 2004

Thanks for the suggestion Sean and for making your NSZombie test app
available.

By using your example I have made sure that I'm enabling zombies
correctly within my app.  From what I can tell it seems that I'm not
creating any zombie objects.  I do, however, definitely have some kind
of malloc problem.

I have done a great deal of searching around today to try to establish
the cause of my EXC_BAD_ACCESS bug.  The exception that I get is
inconsistent - it never seems to happen in the same place.  Usually
though it is occurring somewhere deep within Quartz.

Often I will see a malloc error before my app crashes, reporting an
incorrect checksum for a freed object.  If I use malloc_history to find
references to that block I often find that it was allocated and
deallocated within Quartz routines, however it is occasionally from
something completely different.  This information though does not seem
very relevant...

It seems fairly clear to me that I have a memory corruption problem. 
Somehow, somewhere, I'm asking for a chunk (or several chunks) of
memory and then overrunning those memory blocks.

How I'm managing to do that though is a bit of a mystery to me.  I'm
fairly certain I allocate memory correctly everywhere I use it. 
MallocDebug isn't providing me with any useful information since it
doesn't keep information after an application crash.  GDB has allowed
me to verify that my data is intact, or at least seems to be, at the
time of crashes, but that hasn't helped me get any closer to working
out what the bug is.

I'm at a bit of a loss right now as to how to track this bug down
further.  Any suggestions would be most gratefully received.

Steve


On 24 Aug 2004, at 02:20, Sean McBride wrote:
> Either way works, I just tried.
>
> In fact, I have been reading about/testing NSZombie stuff recently, and
> decided to make a simple test app illustrating its use.  Feel free to
> take a look:
>  <http://www.cam.org/~cwatson/>
>
> The biggest problems I had were:
> - be sure to set variables to YES/NO, not 1/0
> - NSZombie does not help with toll-free bridged classes
> - NSHangOnMallocError is apparently broken

_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlHow to find EXC_BAD_ACCESS bug? Andrew Duncan Aug 18, 00:13
mlRe: How to find EXC_BAD_ACCESS bug? John C. Randolph Aug 18, 00:39
mlRe: How to find EXC_BAD_ACCESS bug? Nick Zitzmann Aug 18, 00:44
mlRe: How to find EXC_BAD_ACCESS bug? Andrew Duncan Aug 18, 00:59
mlRe: How to find EXC_BAD_ACCESS bug? Andrew Duncan Aug 18, 01:03
mlRe: How to find EXC_BAD_ACCESS bug? Nick Zitzmann Aug 18, 01:16
mlRe: How to find EXC_BAD_ACCESS bug? Frederick Cheung Aug 18, 01:29
mlRe: How to find EXC_BAD_ACCESS bug? John C. Randolph Aug 18, 01:29
mlRe: How to find EXC_BAD_ACCESS bug? Stéphane Sudre Aug 18, 21:35
mlRe: How to find EXC_BAD_ACCESS bug? Andrew Duncan Aug 18, 23:35
mlRe: How to find EXC_BAD_ACCESS bug? John C. Randolph Aug 19, 00:38
mlRe: How to find EXC_BAD_ACCESS bug? Andrew Duncan Aug 19, 00:49
mlRe: How to find EXC_BAD_ACCESS bug? Steve Sims Aug 24, 03:25
mlRe: How to find EXC_BAD_ACCESS bug? Sean McBride Aug 24, 04:13
mlRe: How to find EXC_BAD_ACCESS bug? Nick Zitzmann Aug 24, 04:13
mlRe: How to find EXC_BAD_ACCESS bug? Sean McBride Aug 24, 08:20
mlRe: How to find EXC_BAD_ACCESS bug? Steve Sims Aug 25, 01:06
mlRe: How to find EXC_BAD_ACCESS bug? Eric Peden Aug 25, 22:28
mlRe: How to find EXC_BAD_ACCESS bug? Sean McBride Aug 26, 04:58
mlRe: How to find EXC_BAD_ACCESS bug? Steve Sims Aug 29, 00:27
mlRe: How to find EXC_BAD_ACCESS bug? Sean McBride Aug 29, 21:47