1

I'm unable to understand this crash log from Apple. I have been a few times rejected because of this. They are complaining it's occurred on ipad running latest software 10.3.1. When we double check with on ipad simulator, it's running without crashes.

Last Exception Backtrace:
0   CoreFoundation                  0x1848b2fd8 __exceptionPreprocess + 124
1   libobjc.A.dylib                 0x183314538 objc_exception_throw + 56
2   CoreFoundation                  0x1848b2eac +[NSException raise:format:arguments:] + 104
3   Foundation                      0x18534a710 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 112
4   UIKit                           0x18ac57454 -[UIApplication _cachedSystemAnimationFenceCreatingIfNecessary:] + 196
5   UIKit                           0x18ac57514 -[UIApplication _systemAnimationFenceCreatingIfNecessary:] + 24
6   UIKit                           0x18acb07a0 +[UIWindow _synchronizedDrawingFence] + 116
7   UIKit                           0x18ae6e150 +[_UIKeyboardChangedInformation informationForKeyboardUp:withIAV:] + 104
8   UIKit                           0x18b1678d4 -[_UIRemoteKeyboards prepareToMoveKeyboard:withIAV:showing:forScreen:] + 464
9   UIKit                           0x18aa9fc04 -[UIPeripheralHost(UIKitInternal) setInputViews:animationStyle:] + 820
10  UIKit                           0x18aabccf4 -[UIPeripheralHost(UIKitInternal) _restoreInputViewsWithId:animated:] + 584
11  UIKit                           0x18ad4fd64 -[UIViewController _restoreInputViewsForPresentation] + 280
12  UIKit                           0x18ad2ae3c -[UIPresentationController runTransitionForCurrentState] + 1560
13  UIKit                           0x18ad290f8 -[UIPresentationController _dismissWithAnimationController:interactionController:target:didEndSelector:] + 764
14  UIKit                           0x18ad4f8c0 -[UIViewController _dismissViewControllerWithAnimationController:interactionController:completion:] + 464
15  UIKit                           0x18ab04cd4 -[UIViewController _dismissViewControllerWithTransition:from:completion:] + 600
16  UIKit                           0x18aaacb6c -[UIViewController dismissViewControllerWithTransition:completion:] + 1144
17  UIKit                           0x18aaac94c -[UIViewController dismissViewControllerWithTransition:completion:] + 600
18  UIKit                           0x18ad4eb68 -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 524
19  UIKit                           0x18aaac6c0 -[UIViewController dismissViewControllerAnimated:completion:] + 152
20  newapp                          0x100115628 0x1000b0000 + 415272
21  newapp                          0x1001159e8 0x1000b0000 + 416232
22  CFNetwork                       0x184ebc1fc __75-[__NSURLSessionLocal taskForClass:request:uploadFile:bodyData:completion:]_block_invoke + 32
23  CFNetwork                       0x184ed3ef8 __49-[__NSCFLocalSessionTask _task_onqueue_didFinish]_block_invoke + 148
24  Foundation                      0x185381804 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16
25  Foundation                      0x1852c6760 -[NSBlockOperation main] + 96
26  Foundation                      0x1852b6b18 -[__NSOperationInternal _start:] + 612
27  Foundation                      0x185383ba0 __NSOQSchedule_f + 228
28  libdispatch.dylib               0x18376a9a0 _dispatch_client_callout + 16
29  libdispatch.dylib               0x183778ad4 _dispatch_queue_serial_drain + 928
30  libdispatch.dylib               0x18376e2cc _dispatch_queue_invoke + 884
31  libdispatch.dylib               0x18377aa50 _dispatch_root_queue_drain + 540
32  libdispatch.dylib               0x18377a7d0 _dispatch_worker_thread3 + 124
33  libsystem_pthread.dylib         0x1839731d0 _pthread_wqthread + 1096
34  libsystem_pthread.dylib         0x183972d7c start_wqthread + 4


Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0:
0   libsystem_kernel.dylib          0x000000018388f224 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x000000018388f09c mach_msg + 72
2   CoreFoundation                  0x0000000184860e88 __CFRunLoopServiceMachPort + 192
3   CoreFoundation                  0x000000018485eadc __CFRunLoopRun + 1060
4   CoreFoundation                  0x000000018478ed94 CFRunLoopRunSpecific + 424
5   GraphicsServices                0x00000001861f8074 GSEventRunModal + 100
6   UIKit                           0x000000018aa40130 UIApplicationMain + 208
7   newapp                          0x000000010022f390 0x1000b0000 + 1569680
8   libdyld.dylib                   0x000000018379d59c start + 4

Thread 1 name:  com.apple.uikit.eventfetch-thread
Thread 1:
0   libsystem_kernel.dylib          0x000000018388f224 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x000000018388f09c mach_msg + 72
2   CoreFoundation                  0x0000000184860e88 __CFRunLoopServiceMachPort + 192
3   CoreFoundation                  0x000000018485eadc __CFRunLoopRun + 1060
4   CoreFoundation                  0x000000018478ed94 CFRunLoopRunSpecific + 424
5   Foundation                      0x00000001852a8d64 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304
6   Foundation                      0x00000001852c9b34 -[NSRunLoop(NSRunLoop) runUntilDate:] + 96
7   UIKit                           0x000000018b3ca5f8 -[UIEventFetcher threadMain] + 136
8   Foundation                      0x00000001853a62c8 __NSThread__start__ + 996
9   libsystem_pthread.dylib         0x000000018397575c _pthread_body + 240
10  libsystem_pthread.dylib         0x000000018397566c _pthread_body + 0
11  libsystem_pthread.dylib         0x0000000183972d84 thread_start + 4

Thread 2:
0   libsystem_kernel.dylib          0x00000001838ada88 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x0000000183973274 _pthread_wqthread + 1260
2   libsystem_pthread.dylib         0x0000000183972d7c start_wqthread + 4

Thread 3 name:  com.apple.CFStream.LegacyThread
Thread 3:
0   libsystem_kernel.dylib          0x000000018388f224 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x000000018388f09c mach_msg + 72
2   CoreFoundation                  0x0000000184860e88 __CFRunLoopServiceMachPort + 192
3   CoreFoundation                  0x000000018485eadc __CFRunLoopRun + 1060
4   CoreFoundation                  0x000000018478ed94 CFRunLoopRunSpecific + 424
5   CoreFoundation                  0x000000018486e78c _legacyStreamRunLoop_workThread + 268
6   libsystem_pthread.dylib         0x000000018397575c _pthread_body + 240
7   libsystem_pthread.dylib         0x000000018397566c _pthread_body + 0
8   libsystem_pthread.dylib         0x0000000183972d84 thread_start + 4

Thread 4 name:  com.apple.NSURLConnectionLoader
Thread 4:
0   libsystem_kernel.dylib          0x000000018388f224 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x000000018388f09c mach_msg + 72
2   CoreFoundation                  0x0000000184860e88 __CFRunLoopServiceMachPort + 192
3   CoreFoundation                  0x000000018485eadc __CFRunLoopRun + 1060
4   CoreFoundation                  0x000000018478ed94 CFRunLoopRunSpecific + 424
5   CFNetwork                       0x0000000184f9aca4 +[NSURLConnection(Loader) _resourceLoadLoop:] + 404
6   Foundation                      0x00000001853a62c8 __NSThread__start__ + 996
7   libsystem_pthread.dylib         0x000000018397575c _pthread_body + 240
8   libsystem_pthread.dylib         0x000000018397566c _pthread_body + 0
9   libsystem_pthread.dylib         0x0000000183972d84 thread_start + 4

Thread 5 name:  Dispatch queue: NSOperationQueue 0x170031360 :: NSOperation 0x17024ab30 (QOS: DEFAULT)
Thread 5 Crashed:
0   libsystem_kernel.dylib          0x00000001838ad014 __pthread_kill + 8
1   libsystem_pthread.dylib         0x0000000183977334 pthread_kill + 112
2   libsystem_c.dylib               0x00000001838219c4 abort + 140
3   libc++abi.dylib                 0x00000001832ed1b0 __cxa_bad_cast + 0
4   libc++abi.dylib                 0x0000000183306c04 default_unexpected_handler() + 0
5   libobjc.A.dylib                 0x0000000183314820 _objc_terminate() + 124
6   libc++abi.dylib                 0x00000001833035d4 std::__terminate(void (*)()) + 16
7   libc++abi.dylib                 0x0000000183303640 std::terminate() + 60
8   libdispatch.dylib               0x000000018376a9b4 _dispatch_client_callout + 36
9   libdispatch.dylib               0x0000000183778ad4 _dispatch_queue_serial_drain + 928
10  libdispatch.dylib               0x000000018376e2cc _dispatch_queue_invoke + 884
11  libdispatch.dylib               0x000000018377aa50 _dispatch_root_queue_drain + 540
12  libdispatch.dylib               0x000000018377a7d0 _dispatch_worker_thread3 + 124
13  libsystem_pthread.dylib         0x00000001839731d0 _pthread_wqthread + 1096
14  libsystem_pthread.dylib         0x0000000183972d7c start_wqthread + 4
Cœur
  • 37,241
  • 25
  • 195
  • 267
damniatx
  • 234
  • 6
  • 20
  • Do you have any further information (e.g., exception name, etc) or this is it? – Paulo Mattos Apr 14 '17 at 23:43
  • From where I stand, it looks like a crash *after* you finish uploading a file... makes sense? – Paulo Mattos Apr 14 '17 at 23:45
  • Make sure you are dismissing the view controller from the main queue and not a background queue. – rmaddy Apr 14 '17 at 23:46
  • Hi Guys, here is the full log. [https://pastebin.com/4Qs9A9Ly](https://pastebin.com/4Qs9A9Ly) This occur after sending a submit request to http address. and its only happen on ipad when being tested by apple. I can't replicate on my iPhone and not on ipad simulator. any suggestion. Thanks – damniatx Apr 14 '17 at 23:51
  • Possible duplicate of [iPhone App Crash with error \[UIApplication \_cachedSystemAnimationFenceCreatingIfNecessary:\]](https://stackoverflow.com/questions/39695328/iphone-app-crash-with-error-uiapplication-cachedsystemanimationfencecreatingif) – Cœur Aug 07 '18 at 07:43

1 Answers1

3

The log clearly shows the problem happens on a background thread. You need to perform UI actions on the main queue. Use DispatchQueue.main.async to dismiss the view controller.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
  • Looks like you nailed it! The crash indeed happens on thread #5 ;-) – Paulo Mattos Apr 15 '17 at 00:04
  • That was really helpful. Waiting for another review now. Is there any reason why it didn't crash on my device and also simulator ? Slow network ? I can't believe they rejected few times already because of this. Thank you. – damniatx Apr 15 '17 at 00:08