Trouble tracking down a crash

Not entirely cocoa - but Mac programming and I'm happy to be referred
to a better place to ask this.

My app crashes on exit with a memory access violation in objc_msgsnd
(however it is spelled) - it seems to think the number 4 is a pointer
somewhere. The debugger is of little help - it has no stack
information to show me and provides no context information at all.

Tips on how to catch this beastie would be much appreciated. As a
last resort, I'm fixing to just call exit() after the save changed
document step in the exit sequence.

> Not entirely cocoa - but Mac programming and I'm happy to be
> referred to a better place to ask this.
>
> My app crashes on exit with a memory access violation in objc_msgsnd
> (however it is spelled) - it seems to think the number 4 is a
> pointer somewhere. The debugger is of little help - it has no stack
> information to show me and provides no context information at all.

Potentially your stack is hosed. Use google for MALLOC_DEBUG,
NSZombieEnabled and CFZombieLevel.

> Am 18.09.2007 um 19:29 schrieb Todd Blanchard:>> My app crashes on exit with a memory access violation in
>> objc_msgsnd (however it is spelled) - it seems to think the number
>> 4 is a pointer somewhere. The debugger is of little help - it has
>> no stack information to show me and provides no context information
>> at all.>
> Potentially your stack is hosed. Use google for MALLOC_DEBUG,
> NSZombieEnabled and CFZombieLevel.

Don't forget libgmalloc. It can be very useful for debugging
overwrites, underwrites, writes to freed blocks, etc. The
libgmalloc(3) man page <x-man-page://3/libgmalloc> will tell you all
about it and what options you can use with it. There's also a hook in
Xcode (in the Executable inspector) where you can tell it to run an
executable using libgmalloc.