解释崩溃日志而不引用App函数/类

时间:2016-02-09 14:15:42

标签: ios crash

我的上一个应用程序出现了“随机”崩溃(大约有2%的用户似乎遇到了崩溃),但我无法从崩溃日志中找到任何有用的信息。似乎我没有任何对我的代码的引用,我发现很难理解发生了什么以及如何生成崩溃...我在这里粘贴崩溃日志的相关部分,任何有关它的提示或想法?有什么明显的东西让我失踪......

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Last Exception Backtrace:
0   CoreFoundation                  0x18266d900 __exceptionPreprocess + 124 (NSException.m:162)
1   libobjc.A.dylib                 0x181cdbf80 objc_exception_throw + 56 (objc-exception.mm:531)
2   CoreFoundation                  0x18266d7d0 +[NSException raise:format:arguments:] + 108 (NSException.m:131)
3   Foundation                      0x182fe099c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 112 (NSException.m:152)
4   UIKit                           0x187608ac0 -[UIApplication _runWithMainScene:transitionContext:completion:] + 3216 (UIApplication.m:3315)
5   UIKit                           0x1876055c0 -[UIApplication workspaceDidEndTransaction:] + 168 (UIApplication.m:2662)
6   FrontBoardServices              0x183c23790 -[FBSSerialQueue _performNext] + 184 (FBSSerialQueue.m:157)
7   FrontBoardServices              0x183c23b10 -[FBSSerialQueue _performNextFromRunLoopSource] + 56 (FBSSerialQueue.m:204)
8   CoreFoundation                  0x182624efc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 (CFRunLoop.c:1761)
9   CoreFoundation                  0x182624990 __CFRunLoopDoSources0 + 540 (CFRunLoop.c:1807)
10  CoreFoundation                  0x182622690 __CFRunLoopRun + 724 (CFRunLoop.c:2536)
11  CoreFoundation                  0x182551680 CFRunLoopRunSpecific + 384 (CFRunLoop.c:2814)
12  UIKit                           0x1873ce580 -[UIApplication _run] + 460 (UIApplication.m:2503)
13  UIKit                           0x1873c8d90 UIApplicationMain + 204 (UIApplication.m:3681)
14  KickLow                         0x100153604 0x100024000 + 1242628
15  libdyld.dylib                   0x1820f28b8 start + 4 (start_glue.s:80)

Thread 0 name:
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x0000000182210140 __pthread_kill + 8
1   libsystem_pthread.dylib         0x00000001822d8ef8 pthread_kill + 112 (pthread.c:1247)
2   libsystem_c.dylib               0x0000000182181dac abort + 140 (abort.c:91)
3   libc++abi.dylib                 0x0000000181cb53f4 abort_message + 132 (abort_message.cpp:47)
4   libc++abi.dylib                 0x0000000181cd1e98 default_terminate_handler() + 304 (cxa_default_handlers.cpp:67)
5   libobjc.A.dylib                 0x0000000181cdc248 _objc_terminate() + 124 (objc-exception.mm:678)
6   libc++abi.dylib                 0x0000000181ccef44 std::__terminate(void (*)()) + 16 (cxa_handlers.cpp:62)
7   libc++abi.dylib                 0x0000000181cceb10 __cxa_rethrow + 144 (cxa_exception.cpp:480)
8   libobjc.A.dylib                 0x0000000181cdc120 objc_exception_rethrow + 44 (objc-exception.mm:581)
9   CoreFoundation                  0x0000000182551728 CFRunLoopRunSpecific + 552 (CFRunLoop.c:2827)
10  UIKit                           0x00000001873ce580 -[UIApplication _run] + 460 (UIApplication.m:2503)
11  UIKit                           0x00000001873c8d90 UIApplicationMain + 204 (UIApplication.m:3681)
12  KickLow                         0x0000000100153604 0x100024000 + 1242628
13  libdyld.dylib                   0x00000001820f28b8 start + 4 (start_glue.s:80)

2 个答案:

答案 0 :(得分:4)

查看-[UIApplication _runWithMainScene:transitionContext:completion:]方法的反汇编,我们发现了以下内容:

0x111ef155d <+3038>: movq   0xd166b4(%rip), %rdi      ; (void *)0x0000000111ce4b10: NSAssertionHandler
0x111ef1564 <+3045>: movq   0xce0bcd(%rip), %rsi      ; "currentHandler"
0x111ef156b <+3052>: callq  *0xd64c5f(%rip)           ; (void *)0x0000000113e36800: objc_msgSend
0x111ef1571 <+3058>: movq   %rax, %rdi
0x111ef1574 <+3061>: callq  0x1129c0046               ; symbol stub for: objc_retainAutoreleasedReturnValue
0x111ef1579 <+3066>: movq   %rax, %r15
0x111ef157c <+3069>: leaq   0xda427d(%rip), %rax      ; @"Application windows are expected to have a root view controller at the end of application launch"
0x111ef1583 <+3076>: movq   %rax, (%rsp)
0x111ef1587 <+3080>: movl   $0xd3c, %r9d              ; imm = 0xD3C 
0x111ef158d <+3086>: xorl   %eax, %eax
0x111ef158f <+3088>: movq   %r15, %rdi
0x111ef1592 <+3091>: movq   0xce0ba7(%rip), %rsi      ; "handleFailureInMethod:object:file:lineNumber:description:"

所以看来你的应用程序正在创建一个没有根视图控制器的窗口。也许您的视图控制器无法创建。

答案 1 :(得分:-1)

将我的评论移至答案。 @MatterGoal很高兴知道它有所帮助。

您的问题与weird crash when launching app from Notification Center

类似
  

您使用的代码或第三方库是手动旋转runloop。这导致-workspaceDidEndTransaction:被重新调用并在释放后触发使用。如果在 - [NSRunLoop runMode:beforeDate:]和 - [NSRunLoop runUntilDate:]上设置断点,它应该使用前一个堆栈帧上的有罪代码命中。

     

如果可以的话,永远不建议手动旋转运行循环   延迟这样做直到你的应用程序完成启动(所有的   启动app delegate calls received)你应该避免这样做   崩溃。