iOS 5上的应用崩溃

时间:2012-02-05 15:36:27

标签: iphone crash testflight mobclix

我一直在我的应用程序中使用Mobclix并且直到昨天我收到TestFlight的崩溃报告时才遇到任何问题,该报告似乎是由Mobclix引起的。我想知道是否有人可以对这种情况有所了解,或者我是如何阻止它再次发生的。这发生在运行iOS 5.0.1的iPhone 4上。感谢您的任何意见!

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

我还设法从设备获取完整的崩溃日志:

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

以下是所有与Mobclix相关的方法和来自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];
}

2 个答案:

答案 0 :(得分:5)

崩溃的线程1只有Apple框架调用,而您的应用程序中没有任何内容。如果符号化脚本具有可通过Spotlight访问的iOS 5.0.1符号,那么这些将符号化。到目前为止,这个问题看起来不太可能与Mobclix代码有关。

由于异常类型是SIGSEGV,因此您不会在崩溃线程中找到导致崩溃的行号。您的代码中有某处(可能在任何地方!)存在内存问题,导致应用程序尝试访问实际上无效的内存地址。因此,导致崩溃。

由于libdispatch是崩溃线程的一部分,这可能是一个提示,在您的代码中使用GCD的某个地方可能是您的问题所在。如上所述,很可能是记忆问题。

一般而言,我发现可靠查找和解决内存问题的最佳方法是使用测试框架并自动执行应用程序交互,以便运行很长时间。通过一遍又一遍地重做相同的用户交互,它还有助于自动化它。它很可能会崩溃,但这次可以重现,因此您可以将仪器放在一边自动运行。我确实使用了KIF框架并取得了巨大的成功。

要获取完整的崩溃报告,您可能需要查看其他崩溃报告解决方案,我在此处暗示:https://stackoverflow.com/a/8242215/474794

答案 1 :(得分:0)

您只能从TestFlight崩溃报告中的主线程获取堆栈跟踪。然而,可能真正的崩溃发生在另一个线程中,主线程处理它。如果您可以使用相同的回溯重现该崩溃,那么Mobclix中确实存在一个错误。

当您有权访问设备时,您将需要完整的崩溃报告。

您可以在此答案中找到更多有用的信息: https://stackoverflow.com/a/6462751/550177

编辑:正如我所说,真正的崩溃是在一个不同的线程(线程1)。但我无法弄清楚导致坠机的原因。查看涉及 MyApp 的其他回溯(线程4,6和12)。