views:

48

answers:

1

I have an inconsistent crash inside this internal selector. The exception is EXC_BAD_ACCESS, so something has been corrupted. The crash is hard to reproduce, and once it occurs, is not debuggable as the UIView that acts as the receiver can not be inspected. Does anyone have any suggestions for how to debug this crash? I can't even tell which UIView is acting as receiver. Here is one stack with the crash, though it is not the only one:

0  0x00396731 in -[UIView(CALayerDelegate) actionForLayer:forKey:] ()
1  0x029a3222 in -[CALayer actionForKey:] ()
2  0x029a084e in actionForKey ()
3  0x029a07b5 in beginChange ()
4  0x029a5487 in CALayer_setter ()
5  0x029a814c in -[CALayer setContentsRect:] ()
6  0x004216c7 in -[UISegment _updateBackgroundImage] ()
7  0x0041d497 in -[UISegment _commonInitWithInfo:position:autosizeText:] ()
8  0x0042119d in -[UISegment initWithInfo:style:size:barStyle:tintColor:position:isDisclosure:autosizeText:] ()
9  0x0041fd1e in -[UISegmentedControl(Static) _createSegmentAtIndex:position:withInfo:] ()
10 0x00423d61 in -[UISegmentedControl _resetForAppearanceChange] ()
11 0x0041dd4d in -[UISegmentedControl initWithCoder:] ()
12 0x00643f97 in UINibDecoderDecodeObjectForValue ()
13 0x006455d2 in -[UINibDecoder decodeObjectForKey:] ()
14 0x005706ff in -[UIRuntimeConnection initWithCoder:] ()
15 0x00570c7a in -[UIRuntimeEventConnection initWithCoder:] ()
16 0x00643f97 in UINibDecoderDecodeObjectForValue ()
17 0x0064388f in UINibDecoderDecodeObjectForValue ()
18 0x006455d2 in -[UINibDecoder decodeObjectForKey:] ()
19 0x0056fa0a in -[UINib instantiateWithOptions:owner:loadingResourcesFromBundle:] ()
20 0x00571ad9 in -[NSBundle(NSBundleAdditions) loadNibNamed:owner:options:] ()
21 0x00400fa6 in -[UIViewController _loadViewFromNibNamed:bundle:] ()
22 0x003ff030 in -[UIViewController loadView] ()
23 0x003fef0a in -[UIViewController view] ()
24 0x00008899 in -[QueueViewManager loadView] (self=0x4a8f900, _cmd=0x20f99c4) at /Users/shaheen/projects/QueueView/Classes/QueueViewManager.m:58
25 0x003fef0a in -[UIViewController view] ()
26 0x00008c1d in -[QueueViewManager setMainArea:] (self=0x4a8f900, _cmd=0x4557a, r={origin = {x = 0, y = 0}, size = {width = 1024, height = 719}}) at /Users/shaheen/projects/QueueView/Classes/QueueViewManager.m:76
27 0x000048a5 in -[MainViewController viewDidLoad] (self=0x4c51d60, _cmd=0x20f8069) at /Users/shaheen/projects/QueueView/Classes/MainViewController.m:179
28 0x003fef85 in -[UIViewController view] ()
29 0x00003590 in -[StartupFlowLogic viewControllerDismissed] (self=0x4c11e40, _cmd=0x45228) at /Users/shaheen/projects/QueueView/Classes/StartupFlowLogic.m:69
30 0x0000300a in -[SplashScreenViewController dismissComplete] (self=0x4c123d0, _cmd=0x45081) at /Users/shaheen/projects/QueueView/Classes/SplashScreenViewController.m:116
31 0x0038fd54 in -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] ()
32 0x0038fbe6 in -[UIViewAnimationState animationDidStop:finished:] ()
33 0x029d3933 in run_animation_callbacks ()
34 0x029d37da in CA::timer_callback ()
35 0x02aef7dc in CFRunLoopRunSpecific ()
36 0x02aee8a8 in CFRunLoopRunInMode ()
37 0x0329889d in GSEventRunModal ()
38 0x03298962 in GSEventRun ()
39 0x00371372 in UIApplicationMain ()
+1  A: 

I wrote this blog to help understand and debug EXC_BAD_ACCESS

http://loufranco.com/blog/files/Understanding-EXC_BAD_ACCESS.html

In order of easiness

  1. Run a Build and Analyze -- do you get a clean build? Look at what it's saying, but you can ignore leak problems for now -- look for problems of sending messages to released objects

  2. Run with NSZombiesEnabled -- this makes objects never deallocate, and then complain if a message is sent to an object with retainCount of 0.

  3. Enable Guard Malloc and then use the special GDB commands to inspect the integrity of the heap. The problem is that you need to step through and do this before you crash to find the real problem. It might crash somewhere else closer to your problem though

Lou Franco