After an hour chasing a memory allocation problem, this is exactly the kind of humor I needed to start breathing again.
#11 0×92f4b04c in -[NSSavePanel initWithContentRect:styleMask:backing:defer:] #12 0×92f57e0c in +[NSSavePanel _crunchyRawUnbonedPanel] #13 0×00476748 in -[MyDocument exportAllToAIFF:] at MyDocument.m:403
I hate extended bug-chasing sessions and I really, really hate not knowing which object I’ve created may have a pending autorelease on it. If you make it via alloc or copy then expect to own it. Anything else, well, wait for the EXC_BAD_ACCESS error to pop up and then go chase it down. Well, I would, at least, but the stack is in the autorelease pool already and I can’t back into my own code to see when it would have started so I have to go, line by line, and look for variables changed recently that might need a retain on them and do it.

Yeah, it would be very nice if someone would get a real garbage collector for objective c & c++ integrated into the Apple toolchain. The GNUStep team has a working garbage collector, why can’t we?
Uhh, you do know that you can run your program with a few env vars set and it will keep track of all allocs, right? The one I can remember is called MallocStackLogging. The only way I know how to use it is with leaks to get the stack location where each leak was allocated, but there must be some way to do this for the other problem (i.e. over-releasing). Maybe MallocDebug or ObjectAlloc can help here? (I don’t know how to use them but they sound promising
)
Setting the environmental variable NSAutoreleaseFreedObjectCheckEnabled to YES will let you know gently when the autorelease pool releases a dealloc’d object.
Setting NSZombieEnabled to YES will cause every object that would be dealloc’d to instead be turned into a special zombie class that will yell at you when you try to do something with it.
Neither of these can actually pinpoint where the offending release message is being sent, but both give the address of the object so you can poke at it with gdb, and NSZombieEnabled can at least give you the type of object, which can sometimes narrow it down.
Maybe you already know about these; but if not, try them out — they’ve spared me from a lot of headaches.