On Sep 13, 2010, at 9:34 PM, Jeffrey Oleander wrote:

> After my main NSDocument algorithm method was done doing its thing and 
> returned up the call chain to where the button click had started its action, 
> it would flip to showing NSPopAutoreleasePool and I was crashing with 
> EXC_BAD_ACCESS.  So, I looked at all of my alloc, initWith..., retain, and 
> releases.  I did find a couple things which I should have been releasing, but 
> had not, but no obvious ones I had been releasing that I should not have been.
> 
> So, I looked in the archives and on the web and fired up some of the tools, 
> one by one: MallocDebug, ObjectAlloc (and tried malloc_history with no luck 
> at all).  I got these:

What version of the developer tools are you using? MallocDebug and ObjectAlloc 
were replaced by Instruments in Xcode 3, and Instruments is far better at 
debugging these problems than the old tools.

> What I'm wondering is how do I go about tracking down which enumerator is 
> causing the problems?  I'm not explicitly using autorelease pools of my own.

If you're using Snow Leopard, then start up Instruments and use the Zombies 
instrument. Crash the app, and Instruments will show you the bad access.

If you're using Xcode 3 in Leopard, then start up Instruments and use the 
allocations instrument. Also start Console, because you will need to keep an 
eye on the console log. Start your app with the NSZombieEnabled environmental 
variable set to YES, and the instrument set to record reference counts. Then 
crash the app, watch the console log for the memory address, and search the 
trace for that address. Hopefully it won't take long to catch, because 32-bit 
Instruments won't last long with reference counting turned on.

If you're using Xcode 2 or earlier, then you can probably do the same thing 
using ObjectAlloc instead of Instruments.

Nick Zitzmann
<http://www.chronosnet.com/>



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to