iOS 7应用程序崩溃EXC_CRASH(SIGABRT)objc_exception_throw在iOS 6上正常工作

我们的应用程序在iOS 7中崩溃,它在iOS 6中工作正常。我们不确定是什么导致了这个问题。 我们可以看到抛出了一些exception,但是我们不确定代码在哪里造成的。

这是崩溃报告:

Incident Identifier: 1F589930-15BD-49F7-80E6-831A95092FDF CrashReporter Key: aaa79870161ff1e371394b881a26e97f0066f464 Hardware Model: iPhone5,2 Process: myapp [1492] Path: /var/mobile/Applications/A121DF2F-A7B9-4DD9-9FBC-BB06CD7C5EF5/myapp.app/myapp Identifier: co.uk.myapp Version: 1.0 (0.9) Code Type: ARM (Native) Parent Process: launchd [1] Date/Time: 2013-10-01 14:59:17.555 +0530 OS Version: iOS 7.0 (11A465) Report Version: 104 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Triggered by Thread: 2 Last Exception Backtrace: 0 CoreFoundation 0x2d4e4e86 __exceptionPreprocess + 126 1 libobjc.A.dylib 0x377de6c2 objc_exception_throw + 34 2 CoreFoundation 0x2d41e0c6 -[__NSPlaceholderArray initWithObjects:count:] + 414 3 CoreFoundation 0x2d427a4c +[NSArray arrayWithObjects:count:] + 40 4 CoreFoundation 0x2d45d9c0 -[NSDictionary allKeys] + 172 5 Foundation 0x2df73336 -[NSISObjectiveLinearExpression description] + 122 6 Foundation 0x2ddfc808 _NSDescriptionWithLocaleFunc + 84 7 CoreFoundation 0x2d4babf2 __CFStringAppendFormatCore + 5618 8 CoreFoundation 0x2d429d18 _CFStringCreateWithFormatAndArgumentsAux + 72 9 CoreFoundation 0x2d4523c2 _CFLogvEx + 82 10 Foundation 0x2de0b7ee NSLogv + 82 11 Foundation 0x2de0b78e NSLog + 22 12 Foundation 0x2de4a918 -[NSISEngine minimizeConstantInObjectiveRowWithHead:] + 180 13 Foundation 0x2de4a46e -[NSISEngine optimize] + 170 14 Foundation 0x2de461a8 -[NSISEngine withBehaviors:performModifications:] + 312 15 UIKit 0x2fc69490 -[UIView(Hierarchy) _postMovedFromSuperview:] + 292 16 UIKit 0x2feffb92 __UIViewWasRemovedFromSuperview + 214 17 UIKit 0x2fc68342 -[UIView(Hierarchy) removeFromSuperview] + 266 18 UIKit 0x2fd3cccc -[UIScrollView removeFromSuperview] + 60 19 UIKit 0x2fd313e4 -[UINavigationController navigationTransitionView:didEndTransition:fromView:toView:] + 312 20 UIKit 0x2fdfcb5c __49-[UINavigationController _startCustomTransition:]_block_invoke + 156 21 UIKit 0x2fd81416 -[_UIViewControllerTransitionContext completeTransition:] + 70 22 UIKit 0x2fe418dc __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke105 + 448 23 UIKit 0x2fca2618 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 280 24 UIKit 0x2fca226a -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 174 25 UIKit 0x2fca2186 -[UIViewAnimationState animationDidStop:finished:] + 62 26 QuartzCore 0x2f8f8a0e CA::Layer::run_animation_callbacks(void*) + 230 27 libdispatch.dylib 0x37cc30ea _dispatch_client_callout + 18 28 libdispatch.dylib 0x37cc59a4 _dispatch_main_queue_callback_4CF + 264 29 CoreFoundation 0x2d4af5b4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 4 30 CoreFoundation 0x2d4ade80 __CFRunLoopRun + 1304 31 CoreFoundation 0x2d41853c CFRunLoopRunSpecific + 520 32 CoreFoundation 0x2d41831e CFRunLoopRunInMode + 102 33 GraphicsServices 0x3214f2e6 GSEventRunModal + 134 34 UIKit 0x2fccf1e0 UIApplicationMain + 1132 35 myapp 0x00020a16 main (main.mm:16) 36 libdyld.dylib 0x37cd7ab2 tlv_initializer + 2 Thread 0: 0 libsystem_kernel.dylib 0x37d8e588 __semwait_signal_nocancel + 24 1 libsystem_c.dylib 0x37d09788 nanosleep$NOCANCEL + 160 2 libsystem_c.dylib 0x37d24f10 usleep$NOCANCEL + 48 3 libsystem_c.dylib 0x37d3f030 abort + 80 4 myapp 0x001efaea uncaught_exception_handler + 22 5 CoreFoundation 0x2d4e518a __handleUncaughtException + 578 6 libobjc.A.dylib 0x377de924 _objc_terminate() + 172 7 libc++abi.dylib 0x371a51b0 std::__terminate(void (*)()) + 76 8 libc++abi.dylib 0x371a4a04 __cxa_throw + 112 9 libobjc.A.dylib 0x377de796 objc_exception_throw + 246 10 CoreFoundation 0x2d41e0c6 -[__NSPlaceholderArray initWithObjects:count:] + 414 11 CoreFoundation 0x2d427a4c +[NSArray arrayWithObjects:count:] + 40 12 CoreFoundation 0x2d45d9c0 -[NSDictionary allKeys] + 172 13 Foundation 0x2df73336 -[NSISObjectiveLinearExpression description] + 122 14 Foundation 0x2ddfc808 _NSDescriptionWithLocaleFunc + 84 15 CoreFoundation 0x2d4babf4 __CFStringAppendFormatCore + 5620 16 CoreFoundation 0x2d429d18 _CFStringCreateWithFormatAndArgumentsAux + 72 17 CoreFoundation 0x2d4523c2 _CFLogvEx + 82 18 Foundation 0x2de0b7ee NSLogv + 82 19 Foundation 0x2de0b78e NSLog + 22 20 Foundation 0x2de4a918 -[NSISEngine minimizeConstantInObjectiveRowWithHead:] + 180 21 Foundation 0x2de4a46e -[NSISEngine optimize] + 170 22 Foundation 0x2de461a8 -[NSISEngine withBehaviors:performModifications:] + 312 23 UIKit 0x2fc69490 -[UIView(Hierarchy) _postMovedFromSuperview:] + 292 24 UIKit 0x2feffb92 __UIViewWasRemovedFromSuperview + 214 25 UIKit 0x2fc68342 -[UIView(Hierarchy) removeFromSuperview] + 266 26 UIKit 0x2fd3cccc -[UIScrollView removeFromSuperview] + 60 27 UIKit 0x2fd313e4 -[UINavigationController navigationTransitionView:didEndTransition:fromView:toView:] + 312 28 UIKit 0x2fdfcb5c __49-[UINavigationController _startCustomTransition:]_block_invoke + 156 29 UIKit 0x2fd81418 -[_UIViewControllerTransitionContext completeTransition:] + 72 30 UIKit 0x2fe418dc __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke105 + 448 31 UIKit 0x2fca261a -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 282 32 UIKit 0x2fca226a -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 174 33 UIKit 0x2fca2186 -[UIViewAnimationState animationDidStop:finished:] + 62 34 QuartzCore 0x2f8f8a0e CA::Layer::run_animation_callbacks(void*) + 230 35 libdispatch.dylib 0x37cc30ec _dispatch_client_callout + 20 36 libdispatch.dylib 0x37cc59a4 _dispatch_main_queue_callback_4CF + 264 37 CoreFoundation 0x2d4af5b4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 4 38 CoreFoundation 0x2d4ade80 __CFRunLoopRun + 1304 39 CoreFoundation 0x2d41853c CFRunLoopRunSpecific + 520 40 CoreFoundation 0x2d41831e CFRunLoopRunInMode + 102 41 GraphicsServices 0x3214f2e6 GSEventRunModal + 134 42 UIKit 0x2fccf1e0 UIApplicationMain + 1132 43 myapp 0x00020a16 main (main.mm:16) 44 libdyld.dylib 0x37cd7ab4 start + 0 Thread 1: 0 libsystem_kernel.dylib 0x37d7b838 kevent64 + 24 1 libdispatch.dylib 0x37cca0d0 _dispatch_mgr_invoke + 228 2 libdispatch.dylib 0x37cc463e _dispatch_mgr_thread + 34 Thread 2 Crashed: 0 libsystem_kernel.dylib 0x37d8ec7c __workq_kernreturn + 8 1 libsystem_pthread.dylib 0x37df2e06 _pthread_wqthread + 306 2 libsystem_pthread.dylib 0x37df2cc0 start_wqthread + 4 Thread 3 name: com.apple.NSURLConnectionLoader Thread 3: 0 libsystem_kernel.dylib 0x37d7ba84 mach_msg_trap + 20 1 libsystem_kernel.dylib 0x37d7b87c mach_msg + 36 2 CoreFoundation 0x2d4af55c __CFRunLoopServiceMachPort + 152 3 CoreFoundation 0x2d4adc7c __CFRunLoopRun + 788 4 CoreFoundation 0x2d41853c CFRunLoopRunSpecific + 520 5 CoreFoundation 0x2d41831e CFRunLoopRunInMode + 102 6 Foundation 0x2de5364c +[NSURLConnection(Loader) _resourceLoadLoop:] + 316 7 Foundation 0x2dec8dc2 __NSThread__main__ + 1058 8 libsystem_pthread.dylib 0x37df4c5a _pthread_body + 138 9 libsystem_pthread.dylib 0x37df4bca _pthread_start + 98 10 libsystem_pthread.dylib 0x37df2ccc thread_start + 4 Thread 4: 0 libsystem_kernel.dylib 0x37d7ba84 mach_msg_trap + 20 1 libsystem_kernel.dylib 0x37d7b87c mach_msg + 36 2 CoreFoundation 0x2d4af55c __CFRunLoopServiceMachPort + 152 3 CoreFoundation 0x2d4adc7c __CFRunLoopRun + 788 4 CoreFoundation 0x2d41853c CFRunLoopRunSpecific + 520 5 CoreFoundation 0x2d41831e CFRunLoopRunInMode + 102 6 Foundation 0x2de06822 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 250 7 Foundation 0x2de57664 -[NSRunLoop(NSRunLoop) run] + 76 8 myapp 0x001c1ffa +[AFURLConnectionOperation networkRequestThreadEntryPoint:] (AFURLConnectionOperation.m:160) 9 Foundation 0x2dec8dc2 __NSThread__main__ + 1058 10 libsystem_pthread.dylib 0x37df4c5a _pthread_body + 138 11 libsystem_pthread.dylib 0x37df4bca _pthread_start + 98 12 libsystem_pthread.dylib 0x37df2ccc thread_start + 4 Thread 5 name: com.apple.CFSocket.private Thread 5: 0 libsystem_kernel.dylib 0x37d8e440 select$DARWIN_EXTSN + 20 1 CoreFoundation 0x2d4b345e __CFSocketManager + 482 2 libsystem_pthread.dylib 0x37df4c5a _pthread_body + 138 3 libsystem_pthread.dylib 0x37df4bca _pthread_start + 98 4 libsystem_pthread.dylib 0x37df2ccc thread_start + 4 Thread 6: 0 libsystem_kernel.dylib 0x37d8ec7c __workq_kernreturn + 8 1 libsystem_pthread.dylib 0x37df2e06 _pthread_wqthread + 306 2 libsystem_pthread.dylib 0x37df2cc0 start_wqthread + 4 Thread 2 crashed with ARM Thread State (32-bit): r0: 0x00000004 r1: 0x00000000 r2: 0x00000000 r3: 0x00000000 r4: 0x02bcc000 r5: 0x00060001 r6: 0x00004007 r7: 0x02bcbfe0 r8: 0x00000000 r9: 0x00000001 r10: 0x00000000 r11: 0x00000000 ip: 0x00000170 sp: 0x02bcbfc8 lr: 0x37df2e0b pc: 0x37d8ec7c cpsr: 0x40000010 

这崩溃看起来像一个问题,你在你的应用程序中设置的约束(在后台线程?)。

此外,这看起来与您的其他报告的崩溃类似(不完全相同): https : //stackoverflow.com/questions/19114389/app-hang-and-then-crash-ios-7

所以简而言之:你的约束设置(大概是在代码中)会导致这个问题。 很可能是因为你的约束引用了一个不存在的视图。

长:

  1. 从线程2中,一些代码被分配到主线程中:

    28 libdispatch.dylib 0x37cc59a4 _dispatch_main_queue_callback_4CF + 264

  2. 通过导航控制器转换到另一个View Controller确实完成了:

    21 UIKit 0x2fd81416 -[_UIViewControllerTransitionContext completeTransition:] + 70

  3. 正在从其超级视图中移除滚动视图:

    18 UIKit 0x2fd3cccc -[UIScrollView removeFromSuperview] + 60

  4. 正在评估约束条件:

    12 Foundation 0x2de4a918 -[NSISEngine minimizeConstantInObjectiveRowWithHead:] + 180

  5. 约束引擎想要将一些错误logging到控制台中:

    11 Foundation 0x2de0b78e NSLog + 22

  6. 约束引擎尝试生成一个string:

    5 Foundation 0x2df73336 -[NSISObjectiveLinearExpression description] + 122

  7. 发生exception是因为它试图将一个nil对象添加到一个NSArray

如果您的约束规则(在代码中完成)引用另一个不存在的视图,则可能会发生这种情况。 你应该检查你的约束规则并设置断点来找出哪一个导致崩溃。