Suggestions for debugging “EXC_BAD_ACCESS”
Suggestions for debugging “EXC_BAD_ACCESS”
- Subject: Suggestions for debugging “EXC_BAD_ACCESS”
- From: Bob Barnes <email@hidden>
- Date: Fri, 25 Sep 2009 12:14:59 -0700
all,
My iPhone app has a UIView subclass that uses a number of CALayer
objects. In normal operation the app works fine, but in low memory
conditions (either real or simulated) I'm getting a "EXC_BAD_ACCESS"
failure and I suspect it's related to my use (or misuse) of CALayer's.
I've been concentrating my efforts on this particular UIView subclass
because it's the last object to have its dealloc messagecalled before
the crash. As I'm still fairly new developing with Cocoa I'm looking
for suggestions on how others debug these kinds of errors. The stack
at the point of failure is:
#0 0x007d40c0 in CFGetRetainCount
#1 0x00963770 in CA::release_root_if_unused
#2 0x00963707 in x_hash_table_remove_if
#3 0x009634ec in CA::Transaction::commit
#4 0x0096b838 in CA::Transaction::observer_callback
#5 0x007b8252 in __CFRunLoopDoObservers
#6 0x007b765f in CFRunLoopRunSpecific
#7 0x007b6c48 in CFRunLoopRunInMode
#8 0x000737ad in GSEventRunModal
#9 0x00073872 in GSEventRun
#10 0x0168a003 in UIApplicationMain
#11 0x00001ee0 in main at main.m:14
or from the actual crash log:
0 libobjc.A.dylib 0x955b2688 objc_msgSend + 24
1 QuartzCore 0x00963770
CA::release_root_if_unused(_CALayer*, _CALayer*, void*) + 18
2 QuartzCore 0x00963707 x_hash_table_remove_if +
67
3 QuartzCore 0x009634ec
CA::Transaction::commit() + 214
4 QuartzCore 0x0096b838
CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned
long, void*) + 84
5 CoreFoundation 0x007b8252 __CFRunLoopDoObservers + 594
6 CoreFoundation 0x007b765f CFRunLoopRunSpecific + 2575
7 CoreFoundation 0x007b6c48 CFRunLoopRunInMode + 88
8 GraphicsServices 0x000707ad GSEventRunModal + 217
9 GraphicsServices 0x00070872 GSEventRun + 115
10 UIKit 0x0168a003 UIApplicationMain + 1157
11 xxxxxxxx 0x00001ee0 main + 102 (main.m:14)
12 xxxxxxxx 0x00001e4e start + 54
If I'm reading this correctly, not a given by any means, Core
Foundation is trying to get the retain count for an object, possibly a
CALayer, where the reference pointer is no longer valid, but how do I
determine what object? I've tried running with the performance tools,
which tells me where objects are allocated, but I haven't found
anything that will help identify THE object that's causing the
problem. I've tried Shark, but it just seems to hang with
"Sampling...". Any and all suggestions welcome.
thanks,
Bob
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden