3

I'm seeing a strange crash in one of my apps that seems to be coming from a private method on UIAlertView. I've down some searching and found a few other references to this method being involved in crashes such as here, but I'm not convinced that the cause is the same. However to be certain made sure that I always set the UIAlertView delegate to nil whenever the delegate is deallocated.

The stack trace is as follows:

Exception Type:  SIGABRT
Exception Codes: #0 at 0x351ce32c
Crashed Thread:  0

Thread 0 Crashed:
0   libsystem_kernel.dylib              0x351ce32c __pthread_kill + 8
1   libsystem_c.dylib                   0x370c329f abort + 95
2   eLogbook                            0x000bbacd -[GetOperationPartsDictionary init] (GetOperationPartsDictionary.m:22)
3   UIKit                               0x32557f93 -[UIAlertView(Private) _popoutAnimationDidStop:finished:] + 855
4   UIKit                               0x3240dc53 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 471
5   UIKit                               0x3241357d -[UIViewAnimationState animationDidStop:finished:] + 53
6   QuartzCore                          0x36eeac2f CA::Layer::run_animation_callbacks(void*) + 203
7   libdispatch.dylib                   0x3140ae91 _dispatch_main_queue_callback_4CF$VARIANT$up + 197
8   CoreFoundation                      0x353ad2ad __CFRunLoopRun + 1269
9   CoreFoundation                      0x353304a5 CFRunLoopRunSpecific + 301
10  CoreFoundation                      0x3533036d CFRunLoopRunInMode + 105
11  GraphicsServices                    0x3662c439 GSEventRunModal + 137
12  UIKit                               0x32426e7d UIApplicationMain + 1081
13  eLogbook                            0x0007767f main (main.m:14)

The thing that is really confusing me about this is that the -[UIAlertView(Private) _popoutAnimationDidStop:finished:] method appears to be calling the init method on my GetOperationPartsDictionary class. From the limited amount of information I've had from users this crash is happening on startup, at which point that class would not have been loaded.

I'm using QuincyKit to deliver the crash reports to a server, from there they're symbolicated using the standard symbolicatecrash script. The version of Xcode being used to symbolicate the crash is the same version that was used to build the binary, and I'm confident that the dSYM used to symbolicate the crash is the correct one - the line numbers for my code are correct for example.

Anyone have any thoughts on this?

Edit: should have added that this is occurring in the field with a live app, but only occasionally. It has affected maybe 1 or 2 users in a thousand or so, but I have never been able to reproduce it either on a device or in the simulator.

Community
  • 1
  • 1
yod
  • 31
  • 3
  • check out my past questions of tracking down sigabrt errors. specifically read the comments after the answer to use the breakpoint on any exception. http://stackoverflow.com/questions/8072135/how-to-track-down-cause-of-sigabrt – owen gerig Mar 23 '12 at 15:30
  • Thanks, but I should have mentioned that I can't reproduce this myself either on the simulator or on a device, I've just amended the original question. Hence breakpoints aren't going to help :( – yod Mar 23 '12 at 15:55
  • @yod Post some code so that we can help you. – Parth Bhatt Mar 24 '12 at 04:58

1 Answers1

0

Looks like you have called the UIAlertViewDelegate after the alertview has been released.

Release it only in the dealloc method like this :

-(void)dealloc {
    self.alertView.delegate = nil; //setting delegate to nil
    self.alertView = nil; //if you have defined alert as property
    //other release statements of your controller
    [super dealloc];
}
nitin k m p
  • 329
  • 2
  • 22