异常类型:00000020和崩溃线程4是否相关?

时间:2013-11-07 09:56:29

标签: ios iphone objective-c cocoa-touch

实际上这次崩溃并不是每次都会重现,即使不是经常发生,但我们的生产应用程序中发生了这次崩溃。我不确定问题出在哪里。它告诉在环境类第38行的第4个线程中发生了崩溃。

Code:

 NSBundle* bundle = [NSBundle mainBundle];
 NSString* envsPListPath = [bundle pathForResource:@"Environment" ofType:@"plist"];

Line 38:
NSDictionary *environments = [[NSDictionary alloc] initWithContentsOfFile:envsPListPath];

但根据例外类型:00000020,app无法及时启动。 我不明白上面的代码有什么问题。请帮我看看b / w看门狗崩溃和以上代码行的关系。

Crash Log: 

  Incident Identifier: FBDC0D68-9EC3-423C-A0DF-CD08EA079215
    Hardware Model:      iPod4,1
    Process:         Sparkle [16542]
    Path:            /var/mobile/Applications/55887817-5FD2-479A-B124-6ABF1907B339/Sparkle.app/Sparkle
    Identifier:      Sparkle
    Version:         ??? (???)
    Code Type:       ARM (Native)
    Parent Process:  launchd [1]

    Date/Time:       2013-10-26 14:30:43.046 -0400
    OS Version:      iOS 6.1.3 (10B329)
    Report Version:  104

    Exception Type:  00000020
    Exception Codes: 0x000000008badf00d
    Highlighted Thread:  4

    Application Specific Information:
    com.xxxx.xxx failed to launch in time

    Elapsed total CPU time (seconds): 15.060 (user 15.060, system 0.000), 50% CPU 
    Elapsed application CPU time (seconds): 1.756, 6% CPU

    Thread 0 name:  Dispatch queue: com.apple.main-thread
    Thread 0:
    0   libsystem_kernel.dylib          0x3a106eb4 mach_msg_trap + 20
    1   libsystem_kernel.dylib          0x3a107048 mach_msg + 36
    2   UIKit                           0x33ebb7e6 _UIPasteboardServerCreate + 158
    3   UIKit                           0x33ebb684 UIPasteboardServerCreate + 208
    4   UIKit                           0x33ebb54a -[UIPasteboard(Static) _initWithName:system:create:] + 90
    5   UIKit                           0x34055d9c +[UIPasteboard pasteboardWithName:create:] + 292
    6   Sparkle                         0x0049fe8a -[ADMS_Churn readFacebookReferrer] + 42
    7   Sparkle                         0x0049f5ac -[ADMS_Churn setInstallVariables] + 204
    8   Sparkle                         0x0049f2b0 -[ADMS_Churn setLaunchTypeVariables] + 68
    9   Sparkle                         0x0049ead4 -[ADMS_Churn trackSessionStart] + 40
    10  Sparkle                         0x0049ea56 -[ADMS_Churn resumeSession] + 46
    11  Sparkle                         0x004a7ae4 -[ADMS_NotificationHandler handleApplicationNotifications:] + 112
    12  CoreFoundation                  0x31eec034 _CFXNotificationPost + 1424
    13  Foundation                      0x32802594 -[NSNotificationCenter postNotificationName:object:userInfo:] + 68
    14  UIKit                           0x33e03896 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1754
    15  UIKit                           0x33dfb846 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 694
    16  UIKit                           0x33da3c34 -[UIApplication handleEvent:withNewEvent:] + 1000
    17  UIKit                           0x33da36c8 -[UIApplication sendEvent:] + 68
    18  UIKit                           0x33da3116 _UIApplicationHandleEvent + 6150
    19  GraphicsServices                0x35a955a0 _PurpleEventCallback + 588
    20  GraphicsServices                0x35a951ce PurpleEventCallback + 30
    21  CoreFoundation                  0x31f70170 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
    22  CoreFoundation                  0x31f70112 __CFRunLoopDoSource1 + 134
    23  CoreFoundation                  0x31f6ef94 __CFRunLoopRun + 1380
    24  CoreFoundation                  0x31ee1eb8 CFRunLoopRunSpecific + 352
    25  CoreFoundation                  0x31ee1d44 CFRunLoopRunInMode + 100
    26  UIKit                           0x33dfa480 -[UIApplication _run] + 664
    27  UIKit                           0x33df72fc UIApplicationMain + 1116
    28  Sparkle                         0x003fafd2 main (main.m:18)
    29  libdyld.dylib                   0x3a050b1c start + 0

    Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
    Thread 1:
    0   libsystem_kernel.dylib          0x3a107648 kevent64 + 24
    1   libdispatch.dylib               0x3a0404ec _dispatch_mgr_invoke + 792
    2   libdispatch.dylib               0x3a032df4 _dispatch_mgr_thread$VARIANT$up + 32

    Thread 2:
    0   libsystem_kernel.dylib          0x3a117d98 __workq_kernreturn + 8
    1   libsystem_c.dylib               0x3a065cf6 _pthread_workq_return + 14
    2   libsystem_c.dylib               0x3a065a12 _pthread_wqthread + 362
    3   libsystem_c.dylib               0x3a0658a0 start_wqthread + 4

    Thread 3 name:  WebThread
    Thread 3:
    0   libsystem_kernel.dylib          0x3a106eb4 mach_msg_trap + 20
    1   libsystem_kernel.dylib          0x3a107048 mach_msg + 36
    2   CoreFoundation                  0x31f70040 __CFRunLoopServiceMachPort + 124
    3   CoreFoundation                  0x31f6ed9e __CFRunLoopRun + 878
    4   CoreFoundation                  0x31ee1eb8 CFRunLoopRunSpecific + 352
    5   CoreFoundation                  0x31ee1d44 CFRunLoopRunInMode + 100
    6   WebCore                         0x37ecf500 RunWebThread(void*) + 440
    7   libsystem_c.dylib               0x3a07030e _pthread_start + 306
    8   libsystem_c.dylib               0x3a0701d4 thread_start + 4

    Thread 4 name:  Dispatch queue: momentumMapQueue
    Thread 4:
    0   libsystem_c.dylib               0x3a060332 szone_malloc_should_clear + 110
    1   libsystem_c.dylib               0x3a060290 malloc_zone_malloc + 68
    2   CoreFoundation                  0x31eda712 _CFRuntimeCreateInstance + 210
    3   CoreFoundation                  0x31f7953a __CFStringCreateImmutableFunnel3 + 1882
    4   CoreFoundation                  0x31edd6c6 CFStringCreateWithBytes + 46
    5   CoreFoundation                  0x31effe76 _uniqueStringForUTF8Bytes + 90
    6   CoreFoundation                  0x31effd40 parseStringTag + 1304
    7   CoreFoundation                  0x31efe930 parseXMLElement + 2760
    8   CoreFoundation                  0x31efdc8e getContentObject + 450
    9   CoreFoundation                  0x31efe6aa parseXMLElement + 2114
    10  CoreFoundation                  0x31efdc8e getContentObject + 450
    11  CoreFoundation                  0x31efe6aa parseXMLElement + 2114
    12  CoreFoundation                  0x31efdc8e getContentObject + 450
    13  CoreFoundation                  0x31efe1c4 parseXMLElement + 860
    14  CoreFoundation                  0x31f0a044 _CFPropertyListCreateFromUTF8Data + 1592
    15  CoreFoundation                  0x31edcfb6 _CFPropertyListCreateWithData + 882
    16  CoreFoundation                  0x31edcbe0 CFPropertyListCreateFromXMLData + 116
    17  Foundation                      0x328114ea +[NSDictionary(NSDictionary) newWithContentsOf:immutable:] + 110
    18  Sparkle                         0x006c4f66 -[Environments initializeSharedInstance] (Environments.m:38)
    19  Sparkle                         0x006c4d54 +[Environments sharedInstance] (Environments.m:27)
    20  Sparkle                         0x006c4992 +[ConfigurationManager getLogLevel:] (ConfigurationManager.m:54)
    21  Sparkle                         0x006c4870 +[ConfigurationManager logLevelForFileName:] (ConfigurationManager.m:21)
    22  Sparkle                         0x006e824a -[NTRequestPolicy init] (NTRequestPolicy.m:38)
    23  Sparkle                         0x006e80f6 +[NTRequestPolicy sharedRequestPolicy] (NTRequestPolicy.m:24)
    24  Sparkle                         0x004f5fe8 +[WAGServiceHandler execute:requestObject:responseClass:serviceCallBack:requestType:additionalHTTPHeaders:backgroundRequest:] (WAGServiceHandler.m:39)
    25  Sparkle                         0x004f5ed0 +[WAGServiceHandler execute:requestObject:responseClass:serviceCallBack:requestType:] (WAGServiceHandler.m:26)
    26  Sparkle                         0x004f5e72 +[WAGServiceHandler execute:requestObject:responseClass:serviceCallBack:] (WAGServiceHandler.m:20)
    27  Sparkle                         0x0040acaa -[Mbox load] (Mbox.m:118)
    28  Sparkle                         0x0040bf52 -[MBoxHandler invokeMboxManager] (MBoxHandler.m:47)
    29  Sparkle                         0x0040d548 __39-[MomentumMapPlugIn downloadIconImages]_block_invoke (MomentumMapPlugIn.m:222)
    30  libdispatch.dylib               0x3a03111c _dispatch_call_block_and_release + 8
    31  libdispatch.dylib               0x3a030996 _dispatch_queue_drain$VARIANT$up + 142
    32  libdispatch.dylib               0x3a030890 _dispatch_queue_invoke$VARIANT$up + 32
    33  libdispatch.dylib               0x3a03f212 _dispatch_root_queue_drain + 190
    34  libdispatch.dylib               0x3a03f3b4 _dispatch_worker_thread2 + 80
    35  libsystem_c.dylib               0x3a065a0e _pthread_wqthread + 358
    36  libsystem_c.dylib               0x3a0658a0 start_wqthread + 4

4 个答案:

答案 0 :(得分:2)

简单地说,Exception Type 20意味着您正在主线程上进行异步网络连接,并且当连接或操作很慢时,App可以被iOS终止。这将随机发生。请参阅此说明:

https://developer.apple.com/library/ios/qa/qa1693/_index.html

答案 1 :(得分:2)

如果您在崩溃日志中获得Exception Type: 00000020Exception Codes: 0x8badf00d,则看门狗超时崩溃报告。

当您在主线程上同步执行活动时会发生这种情况。 修复此问题是在主线程上异步使用。

Screenshot for this error

Apple document详细介绍了此崩溃的详细信息。

答案 2 :(得分:0)

一件事就像下面那样修改你的代码并进行测试。

    if([[NSFileManager DefaultManger] 
      fileExistAtPath:envsPListPath]){
     NSDictionary *environments = [[NSDictionary
    dictionaryWithContentsOfFile:envsPListPath];
    }

答案 3 :(得分:0)

查找您的应用崩溃的线程并将该线程放入

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
    dispatch_async(dispatch_get_main_queue(), ^{
        // run that crashing thread here.
    });
});