Re: Still can't figure out this overrelease bug
Re: Still can't figure out this overrelease bug
- Subject: Re: Still can't figure out this overrelease bug
- From: Chaz McGarvey <email@hidden>
- Date: Fri, 10 Jun 2005 12:53:38 -0600
On Jun 10, 2005, at 12:00 PM, Theodore H. Smith wrote:
I'm at a loss here. Stepping through every line of the code didn't
give me any clues.
[Switching to process 1201 local thread 0xf03]
Running…
=resolve-pending-breakpoint,new_bp="34",pended_bp="34"
Pending breakpoint 34 - "-[NSException raise]" resolved
=resolve-pending-breakpoint,new_bp="35",pended_bp="35"
Pending breakpoint 35 - "-[_NSZombie methodSignatureForSelector:]"
resolved
Program received signal: "EXC_BAD_ACCESS".
Unable to disassemble objc_msgSend_rtp.
#0 0xfffeff18 in objc_msgSend_rtp
#1 0x92858a88 in NSPopAutoreleasePool
#2 0x93619414 in -[NSApplication run]
#3 0x93709c1c in NSApplicationMain
#4 0x00009670 in main at main.m:13
So how do I pin this overrelease bug down? Someone said these
zombies will help me figure out the class type being overreleased,
but I didn't get that class information.
In my executable pane in Xcode, I have the environment variable
"NSZombieEnabled" enabled with a value of "1".
I also set a symbolic breakpoint in -[_NSZombie
methodSignatureForSelector:] but that did not help.
So how do I figure this out?
Well, in cases where the autorelease pool is releasing released
objects, I always find it very helpful to override the release method
like this (written in Mail.app):
/* ### BEGIN CODE ### */
@interface NSObject ( ReleaseLogger )
- (oneway void)release;
@end
@implementation NSObject ( ReleaseLogger )
- (oneway void)release
{
NSLog( @"RELEASING: %p (%@)\n retcount: %i", self, self, [self
retainCount] );
[super release];
}
@end
/* #### END CODE #### */
Simple, but it will show you useful information like exactly what
object(s) are being released too much.
Never underestimate the power of logging.
chaz
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden