App Crash on iOS 5

3

I have been using Mobclix in my application and haven't experienced any issues until yesterday when I received a crash report from TestFlight which appears to have been caused by Mobclix. I was wondering if anyone could shed any light on the situation or how I might prevent it from happening again. This occurred on an iPhone 4s running iOS 5.0.1. Thanks for any input!

SIGSEGV - Unknown Signal

0 MyApp 0x00136046 testflight_backtrace + 142
1 MyApp 0x00136b60 TFSignalHandler + 212 
2 libsystem_c.dylib 0x35fce538 _sigtramp + 48 
3 CoreFoundation 0x37ab40ba -[__NSCFString isEqualToString:] + 174 
4 QuartzCore 0x332b0b9c -[CALayer actionForKey:] + 76 
5 QuartzCore 0x332b0b18 _ZL12actionForKeyP7CALayerPN2CA11TransactionEP8NSString + 56 
6 QuartzCore 0x332b07c0 _ZN2CA5Layer12begin_changeEPNS_11TransactionEjRP11objc_object + 120 
7 QuartzCore 0x332af8ee _ZN2CA5Layer6setterEj12_CAValueTypePKv + 162 
8 QuartzCore 0x332ddffe -[CALayer setBackgroundColor:] + 34 
9 UIKit 0x34f5dd5c -[UIView(Internal) _setBackgroundCGColor:withSystemColorName:] + 1200 
10 UIKit 0x34f5d80a -[UIView(Hierarchy) _setBackgroundColor:] + 114 
11 MyApp 0x00101e4a -[MobclixAdViewInternal initWithFrame:] (MobclixAdViewInternal.m:79) 
12 MyApp 0x00105e1a -[MobclixAdView setupAdViewWithFrame:] (MobclixAdView.m:72) 
13 MyApp 0x00105fa2 -[MobclixAdView initWithFrame:] (MobclixAdView.m:55) 
14 MyApp 0x000cb550 -[LocationDetailViewController createAdBannerView] (LocationDetailViewController.m:394) 
15 MyApp 0x000c9e0e -[LocationDetailViewController viewDidLoad] (LocationDetailViewController.m:109) 
16 UIKit 0x34f4e7fe -[UIViewController view] + 166 
17 UIKit 0x34f5ac38 -[UIViewController contentScrollView] + 24 
18 UIKit 0x34f5aaa8 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 36 
19 UIKit 0x34f5a98e -[UINavigationController _layoutViewController:] + 34 
20 UIKit 0x34f5a210 -[UINavigationController _startTransition:fromViewController:toViewController:] + 500 
21 UIKit 0x34f59f52 -[UINavigationController _startDeferredTransitionIfNeeded] + 250 
22 UIKit 0x34f4e672 -[UINavigationController pushViewController:transition:forceImmediate:] + 806 
23 UIKit 0x34f4e348 -[UINavigationController pushViewController:animated:] + 36 
24 MyApp 0x000cd7f0 -[LocationsViewController tableView:didSelectRowAtIndexPath:] (LocationsViewController.m:362) 
25 UIKit 0x34fc8564 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 944 
26 UIKit 0x35040ce6 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 158 
27 Foundation 0x31a8e942 __NSFireDelayedPerform + 414 
28 CoreFoundation 0x37b31a62 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 14 
29 CoreFoundation 0x37b316c8 __CFRunLoopDoTimer + 364 
30 CoreFoundation 0x37b3029e __CFRunLoopRun + 1206 
31 CoreFoundation 0x37ab34dc CFRunLoopRunSpecific + 300 
32 CoreFoundation 0x37ab33a4 CFRunLoopRunInMode + 104 
33 GraphicsServices 0x37631fcc GSEventRunModal + 156 
34 UIKit 0x34f43742 UIApplicationMain + 1090 
35 MyApp 0x000c6514 main (main.m:17) 
36 MyApp 0x000c4b6f start + 39

I also managed to get the full crash log from the device:

Incident Identifier: 83282958-196D-444A-9687-3ABB995142B4
CrashReporter Key:   7468d6d075fbaeaa98a71643a55fdc3f52aed471
Hardware Model:      iPhone4,1
Process:         MyApp [11252]
Path:            /var/mobile/Applications/0F320D6D-52F8-4088-B832-CC7454058932/MyApp.app/MyApp
Identifier:      MyApp
Version:         ??? (???)
Code Type:       ARM (Native)
Parent Process:  launchd [1]

Date/Time:       2012-02-04 21:38:51.450 -0500
OS Version:      iPhone OS 5.0.1 (9A405)
Report Version:  104

Exception Type:  EXC_CRASH (SIGSEGV)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread:  1

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0:
0   UIKit                           0x34f178de 0x34f12000 + 22750
1   QuartzCore                      0x332b0b96 0x332ad000 + 15254
2   QuartzCore                      0x332b0b12 0x332ad000 + 15122
3   QuartzCore                      0x332b07ba 0x332ad000 + 14266
4   QuartzCore                      0x332af8e8 0x332ad000 + 10472
5   QuartzCore                      0x332ddff8 0x332ad000 + 200696
6   UIKit                           0x34f5dd56 0x34f12000 + 310614
7   UIKit                           0x34f5d804 0x34f12000 + 309252
8   MyApp                           0x00101e44 -[MobclixAdViewInternal initWithFrame:] (MobclixAdViewInternal.m:79)
9   MyApp                           0x00105e14 -[MobclixAdView setupAdViewWithFrame:] (MobclixAdView.m:72)
10  MyApp                           0x00105f9c -[MobclixAdView initWithFrame:] (MobclixAdView.m:55)
11  MyApp                           0x000cb54a -[LocationDetailViewController createAdBannerView] (LocationDetailViewController.m:394)
12  MyApp                       0x000c9e08 -[LocationDetailViewController viewDidLoad] (LocationDetailViewController.m:109)
13  UIKit                           0x34f4e7f8 0x34f12000 + 247800
14  UIKit                           0x34f5ac32 0x34f12000 + 298034
15  UIKit                           0x34f5aaa2 0x34f12000 + 297634
16  UIKit                           0x34f5a988 0x34f12000 + 297352
17  UIKit                           0x34f5a20a 0x34f12000 + 295434
18  UIKit                           0x34f59f4c 0x34f12000 + 294732
19  UIKit                           0x34f4e66c 0x34f12000 + 247404
20  UIKit                           0x34f4e342 0x34f12000 + 246594
21  MyApp                       0x000cd7ea -[LocationsViewController tableView:didSelectRowAtIndexPath:] (LocationsViewController.m:362)
22  UIKit                           0x34fc855e 0x34f12000 + 746846
23  UIKit                           0x35040ce0 0x34f12000 + 1240288
24  Foundation                      0x31a8e93c 0x319f3000 + 637244
25  CoreFoundation                  0x37b31a5c 0x37aa4000 + 580188
26  CoreFoundation                  0x37b316c2 0x37aa4000 + 579266
27  CoreFoundation                  0x37b30298 0x37aa4000 + 574104
28  CoreFoundation                  0x37ab34d6 0x37aa4000 + 62678
29  CoreFoundation                  0x37ab339e 0x37aa4000 + 62366
30  GraphicsServices                0x37631fc6 0x3762e000 + 16326
31  UIKit                           0x34f4373c 0x34f12000 + 202556
32  MyApp                           0x000c650e main (main.m:17)
33  MyApp                       0x000c4b68 0xc2000 + 11112

Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 1 Crashed:
0   libsystem_kernel.dylib          0x333e73b4 0x333e6000 + 5044
1   libdispatch.dylib               0x3781bf74 0x37818000 + 16244
2   libdispatch.dylib               0x3781bc92 0x37818000 + 15506

Thread 2 name:  WebThread
Thread 2:
0   libsystem_kernel.dylib          0x333e7010 0x333e6000 + 4112
1   libsystem_kernel.dylib          0x333e7206 0x333e6000 + 4614
2   CoreFoundation                  0x37b3141c 0x37aa4000 + 578588
3   CoreFoundation                  0x37b30154 0x37aa4000 + 573780
4   CoreFoundation                  0x37ab34d6 0x37aa4000 + 62678
5   CoreFoundation                  0x37ab339e 0x37aa4000 + 62366
6   WebCore                         0x32384128 0x322dc000 + 688424
7   libsystem_c.dylib               0x35f85c16 0x35f76000 + 64534
8   libsystem_c.dylib               0x35f85ad0 0x35f76000 + 64208

Thread 3 name:  com.apple.NSURLConnectionLoader
Thread 3:
0   libsystem_kernel.dylib          0x333e7010 0x333e6000 + 4112
1   libsystem_kernel.dylib          0x333e7206 0x333e6000 + 4614
2   CoreFoundation                  0x37b3141c 0x37aa4000 + 578588
3   CoreFoundation                  0x37b30154 0x37aa4000 + 573780
4   CoreFoundation                  0x37ab34d6 0x37aa4000 + 62678
5   CoreFoundation                  0x37ab339e 0x37aa4000 + 62366
6   Foundation                      0x31a03bc2 0x319f3000 + 68546
7   Foundation                      0x31a03a8a 0x319f3000 + 68234
8   Foundation                      0x31a9759a 0x319f3000 + 673178
9   libsystem_c.dylib               0x35f85c16 0x35f76000 + 64534
10  libsystem_c.dylib               0x35f85ad0 0x35f76000 + 64208

Thread 4:
0   libsystem_kernel.dylib          0x333e7010 0x333e6000 + 4112
1   libsystem_kernel.dylib          0x333e7206 0x333e6000 + 4614
2   CoreFoundation                  0x37b3141c 0x37aa4000 + 578588
3   CoreFoundation                  0x37b30154 0x37aa4000 + 573780
4   CoreFoundation                  0x37ab34d6 0x37aa4000 + 62678
5   CoreFoundation                  0x37ab339e 0x37aa4000 + 62366
6   Foundation                      0x319f7b7e 0x319f3000 + 19326
7   Foundation                      0x31a1152c 0x319f3000 + 124204
8   MyApp                           0x0014a986 0xc2000 + 559494
9   Foundation                      0x31a03a8a 0x319f3000 + 68234
10  Foundation                      0x31a9759a 0x319f3000 + 673178
11  libsystem_c.dylib               0x35f85c16 0x35f76000 + 64534
12  libsystem_c.dylib               0x35f85ad0 0x35f76000 + 64208

Thread 5 name:  com.apple.CFSocket.private
Thread 5:
0   libsystem_kernel.dylib          0x333f7570 0x333e6000 + 71024
1   CoreFoundation                  0x37b3566a 0x37aa4000 + 595562
2   libsystem_c.dylib               0x35f85c16 0x35f76000 + 64534
3   libsystem_c.dylib               0x35f85ad0 0x35f76000 + 64208

Thread 6:
0   libsystem_kernel.dylib          0x333e7010 0x333e6000 + 4112
1   libsystem_kernel.dylib          0x333e7206 0x333e6000 + 4614
2   CoreFoundation                  0x37b3141c 0x37aa4000 + 578588
3   CoreFoundation                  0x37b30154 0x37aa4000 + 573780
4   CoreFoundation                  0x37ab34d6 0x37aa4000 + 62678
5   CoreFoundation                  0x37b30474 0x37aa4000 + 574580
6   MyApp                           0x002791cc +[UA_ASIHTTPRequest runRequests] (UA_ASIHTTPRequest.m:4789)
7   Foundation                      0x31a03a8a 0x319f3000 + 68234
8   Foundation                      0x31a9759a 0x319f3000 + 673178
9   libsystem_c.dylib               0x35f85c16 0x35f76000 + 64534
10  libsystem_c.dylib               0x35f85ad0 0x35f76000 + 64208

Thread 7 name:  NetworkIO
Thread 7:
0   libsystem_kernel.dylib          0x333e7010 0x333e6000 + 4112
1   libsystem_kernel.dylib          0x333e7206 0x333e6000 + 4614
2   CoreFoundation                  0x37b3141c 0x37aa4000 + 578588
3   CoreFoundation                  0x37b30154 0x37aa4000 + 573780
4   CoreFoundation                  0x37ab34d6 0x37aa4000 + 62678
5   CoreFoundation                  0x37ab339e 0x37aa4000 + 62366
6   MapKit                          0x37d1a412 0x37d0c000 + 58386
7   Foundation                      0x31a03a8a 0x319f3000 + 68234
8   Foundation                      0x31a9759a 0x319f3000 + 673178
9   libsystem_c.dylib               0x35f85c16 0x35f76000 + 64534
10  libsystem_c.dylib               0x35f85ad0 0x35f76000 + 64208

Thread 8:
0   libsystem_kernel.dylib          0x333f7cd4 0x333e6000 + 72916
1   libsystem_c.dylib               0x35f8030a 0x35f76000 + 41738
2   libsystem_c.dylib               0x35f8009c 0x35f76000 + 41116

Thread 9 name:  WebCore: CFNetwork Loader
Thread 9:
0   libsystem_kernel.dylib          0x333e7010 0x333e6000 + 4112
1   libsystem_kernel.dylib          0x333e7206 0x333e6000 + 4614
2   CoreFoundation                  0x37b3141c 0x37aa4000 + 578588
3   CoreFoundation                  0x37b30154 0x37aa4000 + 573780
4   CoreFoundation                  0x37ab34d6 0x37aa4000 + 62678
5   CoreFoundation                  0x37ab339e 0x37aa4000 + 62366
6   WebCore                         0x323ad69e 0x322dc000 + 857758
7   libsystem_c.dylib               0x35f85c16 0x35f76000 + 64534
8   libsystem_c.dylib               0x35f85ad0 0x35f76000 + 64208

Thread 10:
0   libsystem_kernel.dylib          0x333f7cd4 0x333e6000 + 72916
1   libsystem_c.dylib               0x35f8030a 0x35f76000 + 41738
2   libsystem_c.dylib               0x35f8009c 0x35f76000 + 41116

Thread 11:
0   libsystem_kernel.dylib          0x333f7cd4 0x333e6000 + 72916
1   libsystem_c.dylib               0x35f8030a 0x35f76000 + 41738
2   libsystem_c.dylib               0x35f8009c 0x35f76000 + 41116

Thread 12:
0   libsystem_c.dylib               0x35f79254 0x35f76000 + 12884
1   QuartzCore                      0x332af188 0x332ad000 + 8584
2   QuartzCore                      0x332b2ed8 0x332ad000 + 24280
3   QuartzCore                      0x332b7114 0x332ad000 + 41236
4   QuartzCore                      0x332b6e50 0x332ad000 + 40528
5   QuartzCore                      0x332aed7e 0x332ad000 + 7550
6   CoreFoundation                  0x37b31b44 0x37aa4000 + 580420
7   CoreFoundation                  0x37b2fd80 0x37aa4000 + 572800
8   CoreFoundation                  0x37ab34f2 0x37aa4000 + 62706
9   CoreFoundation                  0x37ab339e 0x37aa4000 + 62366
10  Foundation                      0x319f7b7e 0x319f3000 + 19326
11  MyApp                       0x0025d5cc -[DynamoDBWebServiceClient invoke:rawRequest:unmarshallerDelegate:] (DynamoDBWebServiceClient.m:105)
12  MyApp                       0x0025cb28 -[AmazonDynamoDBClient query:] (AmazonDynamoDBClient.m:55)
13  MyApp                           0x000fb2f6 -[MessageManager loadRecentMessagesForLocation:] (MessageManager.m:99)
14  MyApp                           0x000ca2cc -[LocationDetailViewController loadServerData] (LocationDetailViewController.m:181)
15  Foundation                      0x31a03a8a 0x319f3000 + 68234
16  Foundation                      0x31a9759a 0x319f3000 + 673178
17  libsystem_c.dylib               0x35f85c16 0x35f76000 + 64534
18  libsystem_c.dylib               0x35f85ad0 0x35f76000 + 64208

Thread 1 crashed with ARM Thread State:
    r0: 0x00000004    r1: 0x00000000      r2: 0x00000000      r3: 0x2ff9c634
    r4: 0x00000001    r5: 0x2ff9c750      r6: 0x2ff9c750      r7: 0x2ff9c770
    r8: 0x00000000    r9: 0x00000000     r10: 0x3f44e850     r11: 0x00000000
    ip: 0x0000016b    sp: 0x2ff9c620      lr: 0x3781bf7b      pc: 0x333e73b4
  cpsr: 0x60000010

Here are all of Mobclix related methods and calls from LocationDetailViewController:

- (void)adViewDidFinishLoad:(MobclixAdView*)adView {

    if (!adBannerViewIsVisible) { 

        // Show the ad banner
        adBannerViewIsVisible = YES;
        [self fixupAdView];
    }
}

- (void)adView:(MobclixAdView*)adView didFailLoadWithError:(NSError*)error {

    if (adBannerViewIsVisible) {

        // Hide the ad banner
        adBannerViewIsVisible = NO;
        [self fixupAdView];
    }
}

- (void)createAdBannerView {

    // Create the ad banner
    self.adBannerView = [[MobclixAdViewiPhone_320x50 alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 50.0f)];

    self.adBannerView.delegate = self;

    [self.view addSubview:adBannerView];
}

- (void)fixupAdView {

    if (adBannerView != nil) {  

        [UIView beginAnimations:@"fixupViews" context:nil];

        // Move items to fit ad banner
        if (adBannerViewIsVisible) {

            CGRect adBannerViewFrame = [adBannerView frame];
            adBannerViewFrame.origin.x = 0;
            adBannerViewFrame.origin.y = 0;
            [adBannerView setFrame:adBannerViewFrame];

            CGRect contentViewFrame = contentView.frame;
            contentViewFrame.origin.y = 50;
            contentViewFrame.size.height = self.view.frame.size.height - 50;
            contentView.frame = contentViewFrame;

            CGRect tableViewFrame = tableView.frame;
            tableViewFrame.origin.y = tableView.frame.origin.y;
            tableViewFrame.size.height = 317;
            tableView.frame = tableViewFrame;

            // Move items to hide ad banner
        } else {

            CGRect adBannerViewFrame = [adBannerView frame];
            adBannerViewFrame.origin.x = 0;
            adBannerViewFrame.origin.y = -50;
            [adBannerView setFrame:adBannerViewFrame];

            CGRect contentViewFrame = contentView.frame;
            contentViewFrame.origin.y = 0;
            contentViewFrame.size.height = self.view.frame.size.height;
            contentView.frame = contentViewFrame;  

            CGRect tableViewFrame = tableView.frame;
            tableViewFrame.origin.y = tableView.frame.origin.y;
            tableViewFrame.size.height = 367;
            tableView.frame = tableViewFrame;
        }

        [UIView commitAnimations];
    }   
}

- (void)viewDidLoad {

    [super viewDidLoad];

    // Attempt to load an ad and resize the view to fit it
    [self createAdBannerView];
    [self fixupAdView];
}

- (void)viewDidUnload {

    [super viewDidUnload];

    [self.adBannerView cancelAd];
    self.adBannerView.delegate = nil;
    self.adBannerView = nil;
}

- (void)viewDidAppear:(BOOL)animated {

    [super viewDidAppear:animated];

    // Resume ad loading from Mobclix
    [self.adBannerView resumeAdAutoRefresh];
}

- (void)viewWillDisappear:(BOOL)animated {

    [super viewWillDisappear:animated];

    // Pause ad loading from Mobclix
    [self.adBannerView pauseAdAutoRefresh];
}
iphone
crash
testflight
mobclix
asked on Stack Overflow Feb 5, 2012 by Stephen Woodford • edited Feb 5, 2012 by Stephen Woodford

2 Answers

5

The crashing thread 1 has only Apple framework calls, nothing from your app. Those will symbolicate if the symbolication script has the iOS 5.0.1 symbols accessible via Spotlight. It looks unlikely so far that this problem is related to the Mobclix code.

Since the exception type is SIGSEGV you won't find a line number in the crashing thread which causes the crash. You have somewhere (could be anywhere!) in your code a memory problem, which causes the app trying to access a memory address which is actually invalid. Hence, causing the crash.

Since libdispatch is part of the crashing thread, this could be a hint that somewhere in your code where you are using GCD might be the area of your problem. As said, most likely a memory issue.

In general the best way I found to reliable find and resolve memory issues was using a testing framework and automate the app interaction so it runs a long time. It also helps to automate it by redoing the same user interaction over and over again. It will most likely crash, but this time reproducible so you can run the automation with instruments aside. I did use the KIF framework with great success for that.

For getting the full crash reports, you might want to take a look into alternative crash report solutions, which I hinted at here: https://stackoverflow.com/a/8242215/474794

answered on Stack Overflow Feb 7, 2012 by Kerni • edited May 23, 2017 by Community
0

You only get the stacktrace from the main thread in the TestFlight crash report. However possibly the real crash occured in another thread and the main thread handled it. If you can reproduce that crash with the same backtrace then there is really a bug in Mobclix.

You'll need the full crash report, which you can only get, when you have access to the device.

You can find more helpful information in this answer: https://stackoverflow.com/a/6462751/550177

EDIT: As I said, the real crash is in a different thread (Thread 1). But I can't figure out what caused the crash. Look at the other backtraces where MyApp is involved (Thread 4, 6 & 12).

answered on Stack Overflow Feb 5, 2012 by Felix • edited May 23, 2017 by Community

User contributions licensed under CC BY-SA 3.0