CFZombieLevel
CFZombieLevel
- Subject: CFZombieLevel
- From: Jakob Olesen <email@hidden>
- Date: Thu, 21 Sep 2006 16:07:07 +0200
Is setting CFZombieLevel known to be crash prone in Cocoa apps?
I was debugging a weird problem where Core Data was double-freeing
managed object attributes. Since attributes are toll-free bridged
objects, I set CFZombieLevel to 3 and started stripping code to find
the culprit. When I was down to just loading a MainMenu.nib with an
app delegate with an empty awakeFromNib, I got suspicious.
I created a fresh XCode application project from the "Cocoa
Application" template, set CFZombieLevel to 3 for the executable, ran
it, EXC_BAD_ACCESS.
This is a new Cocoa application with only template code. I only
changed the CFZombieLevel setting. I get the error from the command
line too (Segmentation fault), and from command-line gdb:
~/Downloads/build/Debug stoklund@iMac$ env CFZombieLevel=3 gdb
cfzombie.app/Contents/MacOS/cfzombie
GNU gdb 6.3.50-20050815 (Apple version gdb-563) (Wed Jul 19 05:17:43
GMT 2006)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "powerpc-apple-darwin"...Reading symbols
for shared libraries .... done
(gdb) r
Starting program: /Users/stoklund/Downloads/build/Debug/cfzombie.app/
Contents/MacOS/cfzombie
Reading symbols for shared
libraries ..............................................................
.... done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries . done
Reading symbols for shared libraries .............. done
Reading symbols for shared libraries ... done
Reading symbols for shared libraries .. done
Reading symbols for shared libraries . done
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0xfcfcfcfc
[Switching to process 959 thread 0x4707]
0xfcfcfcfc in ?? ()
(gdb) bt
#0 0xfcfcfcfc in ?? ()
Cannot access memory at address 0xfcfcfcfc
Cannot access memory at address 0xfcfcfcfc
Cannot access memory at address 0xfcfcfcfc
Cannot access memory at address 0xfcfcfcfc
Cannot access memory at address 0xfcfcfcfc
Cannot access memory at address 0xfcfcfcfc
#1 0x908321c4 in __CFAllocatorDeallocate ()
Cannot access memory at address 0xfcfcfcfc
Cannot access memory at address 0xfcfcfcfc
Cannot access memory at address 0xfcfcfcfc
Cannot access memory at address 0xfcfcfcfc
Cannot access memory at address 0xfcfcfcfc
#2 0x907d86c4 in __CFDataDeallocate ()
Cannot access memory at address 0xfcfcfcfc
#3 0x907bbf34 in _CFRelease ()
#4 0x919baf30 in _CGImageReadFinalize ()
#5 0x907bbf34 in _CFRelease ()
#6 0x919bada8 in _CGImageSourceFinalize ()
#7 0x907bbf34 in _CFRelease ()
#8 0x98563720 in InitializationThread ()
#9 0x9002bc28 in _pthread_body ()
Clearly CFZombie is scribbling somewhere it shouldn't. (Or it is
working as indended, depending on how you look at it).
I had spotted Kotoeri in some stack traces earlier, so I switched to
a US keyboard layout (I was using Japanese). Then I can't reproduce
the crash. However, using a Chinese keyboard crashes too, so I don't
think Kotoeri is to blame. It is just a matter of how much code is
running during startup.
If I load the debug or profile frameworks, I crash with a US keyboard
too. This time somewhere in the bowels of ATSUI in the main thread.
Again, this is not my code, it is a fresh Cocoa Application template
project. /Library/InputManagers and ~/Library/InputManagers are empty.
Safari crashes with the same stack trace. iTunes does not like to be
run under gdb (DRM?), but gives a Segmentation fault when run without
gdb.
What is going on? Did I mess up my installation somehow, or is
CFZombie simply not usable with the current framework versions?
Does the folowing command crash on your machine?
env CFZombieLevel=3 /Applications/Safari.app/Contents/MacOS/Safari
_______________________________________________
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