NSZombieEnabled still allows crash. Was: (gdb) Won't Answer...
NSZombieEnabled still allows crash. Was: (gdb) Won't Answer...
- Subject: NSZombieEnabled still allows crash. Was: (gdb) Won't Answer...
- From: Jerry Krinock <email@hidden>
- Date: Sat, 7 Mar 2009 12:58:12 -0800
On 2009 Mar 07, at 08:15, Keary Suska wrote:
With NSZombie enabled you the double free shouldn't even happen.
Nothing is supposed to actually get released. Have you tried a
CFZombieLevel 3?
Yes, come to think of it, you are correct. I enable zombies for
debugging, in main(), like this:
int main(int argc, const char *argv[]) {
#ifdef DEBUG
setenv("NSZombieEnabled", "YES", 1) ;
setenv("NSAutoreleaseFreedObjectCheckEnabled", "YES", 1) ;
#endif
if (getenv("NSZombieEnabled")) {
NSLog (@"NSZombieEnabled for debugging.") ;
}
if (getenv("NSAutoreleaseFreedObjectCheckEnabled")) {
NSLog (@"NSAutoreleaseFreedObjectCheckEnabled for
debugging.") ;
}
return NSApplicationMain(argc, argv);
}
But if I add this double-release code:
- (void)applicationDidFinishLaunching:(NSNotification *)note {
NSDate* s = [NSDate date] ;
NSLog(@"18409: %@", s) ;
[s release] ;
NSLog(@"18452: ") ;
NSLog(@"18418: %@", s) ;
...
I still get a an old-fashioned crash:
NSZombieEnabled for debugging.
NSAutoreleaseFreedObjectCheckEnabled for debugging.
18409: 2009-03-07 12:53:29 -0800
18452:
[Session started at 2009-03-07 12:53:30 -0800.]
Loading program into debugger…
...
Have you tried a CFZombieLevel 3?
No, actually I found and fixed the problem yesterday by selectively
eliminating new code. _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden