ios - 解读iOS崩溃日志与-[UIApplication _cachedSystemAnimationFenceCreatingIfNecessary :]

标签 ios swift thread-safety uikit crash-reports

我向 App Store 提交的内容因崩溃而被拒绝。但是,我无法在多个硬件设备和模拟器上重现崩溃。我已经用符号表示了崩溃日志,问题似乎出现在应用程序从服务器获取一些数据并关闭通知用户“请稍候...”的 UIAlertController 的代码区域中日志。

Date/Time:           2017-05-06 00:27:06.7009 +0700
Launch Time:         2017-05-06 00:26:43.8793 +0700
OS Version:          iPhone OS 10.3.1 (14E304)
Report Version:      104

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

Application Specific Information:
abort() called

Filtered syslog:
None found

Last Exception Backtrace:
0   CoreFoundation                  0x18c47efd8 __exceptionPreprocess + 124
1   libobjc.A.dylib                 0x18aee0538 objc_exception_throw + 56
2   CoreFoundation                  0x18c47eeac +[NSException raise:format:arguments:] + 104
3   Foundation                      0x18cf16710 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 112
4   UIKit                           0x192823454 -[UIApplication _cachedSystemAnimationFenceCreatingIfNecessary:] + 196
5   UIKit                           0x192823514 -[UIApplication _systemAnimationFenceCreatingIfNecessary:] + 24
6   UIKit                           0x19287c7a0 +[UIWindow _synchronizedDrawingFence] + 116
7   UIKit                           0x192a3a150 +[_UIKeyboardChangedInformation informationForKeyboardUp:withIAV:] + 104
8   UIKit                           0x192d338d4 -[_UIRemoteKeyboards prepareToMoveKeyboard:withIAV:showing:forScreen:] + 464
9   UIKit                           0x19266bc04 -[UIPeripheralHost(UIKitInternal) setInputViews:animationStyle:] + 820
10  UIKit                           0x192688cf4 -[UIPeripheralHost(UIKitInternal) _restoreInputViewsWithId:animated:] + 584
11  UIKit                           0x19291bd64 -[UIViewController _restoreInputViewsForPresentation] + 280
12  UIKit                           0x1928f6e3c -[UIPresentationController runTransitionForCurrentState] + 1560
13  UIKit                           0x1928f50f8 -[UIPresentationController _dismissWithAnimationController:interactionController:target:didEndSelector:] + 764
14  UIKit                           0x19291b8c0 -[UIViewController _dismissViewControllerWithAnimationController:interactionController:completion:] + 464
15  UIKit                           0x1926d0cd4 -[UIViewController _dismissViewControllerWithTransition:from:completion:] + 600
16  UIKit                           0x192678b6c -[UIViewController dismissViewControllerWithTransition:completion:] + 1144
17  UIKit                           0x19267894c -[UIViewController dismissViewControllerWithTransition:completion:] + 600
18  UIKit                           0x19291ab68 -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 524
19  UIKit                           0x1926786c0 -[UIViewController dismissViewControllerAnimated:completion:] + 152
20  DinokEtp                        0x1001014c4 specialized ViewController.(downloadCaseTypesFile(workFlowVersionMobileShouleBeOn : Double, validateUserResponse : ValidateUserResponse) -> ()).(closure #1) (ViewController.swift:360)
21  DinokEtp                        0x1000fd84c ViewController.(downloadCaseTypesFile(workFlowVersionMobileShouleBeOn : Double, validateUserResponse : ValidateUserResponse) -> ()).(closure #1) (ViewController.swift:0)
22  DinokEtp                        0x100101b38 partial apply for ViewController.(downloadCaseTypesFile(workFlowVersionMobileShouleBeOn : Double, validateUserResponse : ValidateUserResponse) -> ()).(closure #1) (ViewController.swift:0)
23  CFNetwork                       0x18ca89358 __85-[__NSURLSessionLocal downloadTaskForRequest:downloadFilePath:resumeData:completion:]_block_invoke + 32
24  CFNetwork                       0x18caeb18c __50-[__NSCFLocalDownloadTask _private_fileCompletion]_block_invoke.321 + 84
25  Foundation                      0x18cf4d804 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 16
26  Foundation                      0x18ce92760 -[NSBlockOperation main] + 96
27  Foundation                      0x18ce82b18 -[__NSOperationInternal _start:] + 612
28  Foundation                      0x18cf4fba0 __NSOQSchedule_f + 228
29  libdispatch.dylib               0x18b3369a0 _dispatch_client_callout + 16
30  libdispatch.dylib               0x18b344ad4 _dispatch_queue_serial_drain + 928
31  libdispatch.dylib               0x18b33a2cc _dispatch_queue_invoke + 884
32  libdispatch.dylib               0x18b346a50 _dispatch_root_queue_drain + 540
33  libdispatch.dylib               0x18b3467d0 _dispatch_worker_thread3 + 124
34  libsystem_pthread.dylib         0x18b53f1d0 _pthread_wqthread + 1096
35  libsystem_pthread.dylib         0x18b53ed7c start_wqthread + 4


Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0:
0   libsystem_kernel.dylib          0x000000018b45b224 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x000000018b45b09c mach_msg + 72
2   CoreFoundation                  0x000000018c42ce88 __CFRunLoopServiceMachPort + 192
3   CoreFoundation                  0x000000018c42aadc __CFRunLoopRun + 1060
4   CoreFoundation                  0x000000018c35ad94 CFRunLoopRunSpecific + 424
5   GraphicsServices                0x000000018ddc4074 GSEventRunModal + 100
6   UIKit                           0x000000019260c130 UIApplicationMain + 208
7   DinokEtp                        0x00000001000654bc main (EMSCaseUpload.swift:14)
8   libdyld.dylib                   0x000000018b36959c start + 4

Thread 1 name:  Dispatch queue: NSOperationQueue 0x17003e2c0 :: NSOperation 0x17025e5d0 (QOS: DEFAULT)
Thread 1 Crashed:
0   libsystem_kernel.dylib          0x000000018b479014 __pthread_kill + 8
1   libsystem_pthread.dylib         0x000000018b543334 pthread_kill + 112
2   libsystem_c.dylib               0x000000018b3ed9c4 abort + 140
3   libc++abi.dylib                 0x000000018aeb91b0 __cxa_bad_cast + 0
4   libc++abi.dylib                 0x000000018aed2c04 default_unexpected_handler() + 0
5   libobjc.A.dylib                 0x000000018aee0820 _objc_terminate() + 124
6   libc++abi.dylib                 0x000000018aecf5d4 std::__terminate(void (*)()) + 16
7   libc++abi.dylib                 0x000000018aecf640 std::terminate() + 60
8   libdispatch.dylib               0x000000018b3369b4 _dispatch_client_callout + 36
9   libdispatch.dylib               0x000000018b344ad4 _dispatch_queue_serial_drain + 928
10  libdispatch.dylib               0x000000018b33a2cc _dispatch_queue_invoke + 884
11  libdispatch.dylib               0x000000018b346a50 _dispatch_root_queue_drain + 540
12  libdispatch.dylib               0x000000018b3467d0 _dispatch_worker_thread3 + 124
13  libsystem_pthread.dylib         0x000000018b53f1d0 _pthread_wqthread + 1096
14  libsystem_pthread.dylib         0x000000018b53ed7c start_wqthread + 4

Thread 2:
0   libsystem_pthread.dylib         0x000000018b53ed78 start_wqthread + 0

Thread 3 name:  com.apple.uikit.eventfetch-thread
Thread 3:
0   libsystem_kernel.dylib          0x000000018b45b224 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x000000018b45b09c mach_msg + 72
2   CoreFoundation                  0x000000018c42ce88 __CFRunLoopServiceMachPort + 192
3   CoreFoundation                  0x000000018c42aadc __CFRunLoopRun + 1060
4   CoreFoundation                  0x000000018c35ad94 CFRunLoopRunSpecific + 424
5   Foundation                      0x000000018ce74d64 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304
6   Foundation                      0x000000018ce95b34 -[NSRunLoop(NSRunLoop) runUntilDate:] + 96
7   UIKit                           0x0000000192f965f8 -[UIEventFetcher threadMain] + 136
8   Foundation                      0x000000018cf722c8 __NSThread__start__ + 996
9   libsystem_pthread.dylib         0x000000018b54175c _pthread_body + 240
10  libsystem_pthread.dylib         0x000000018b54166c _pthread_body + 0
11  libsystem_pthread.dylib         0x000000018b53ed84 thread_start + 4

Thread 4:
0   libsystem_kernel.dylib          0x000000018b479a88 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x000000018b53f274 _pthread_wqthread + 1260
2   libsystem_pthread.dylib         0x000000018b53ed7c start_wqthread + 4

Thread 5:
0   libsystem_pthread.dylib         0x000000018b53ed78 start_wqthread + 0

Thread 6 name:  com.apple.NSURLConnectionLoader
Thread 6:
0   libsystem_kernel.dylib          0x000000018b45b224 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x000000018b45b09c mach_msg + 72
2   CoreFoundation                  0x000000018c42ce88 __CFRunLoopServiceMachPort + 192
3   CoreFoundation                  0x000000018c42aadc __CFRunLoopRun + 1060
4   CoreFoundation                  0x000000018c35ad94 CFRunLoopRunSpecific + 424
5   CFNetwork                       0x000000018cb66ca4 +[NSURLConnection(Loader) _resourceLoadLoop:] + 404
6   Foundation                      0x000000018cf722c8 __NSThread__start__ + 996
7   libsystem_pthread.dylib         0x000000018b54175c _pthread_body + 240
8   libsystem_pthread.dylib         0x000000018b54166c _pthread_body + 0
9   libsystem_pthread.dylib         0x000000018b53ed84 thread_start + 4

Thread 1 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000000   x2: 0x0000000000000000   x3: 0x00000001700f8c37
    x4: 0x000000018aed3b07   x5: 0x000000016de9a850   x6: 0x000000000000006e   x7: 0xffffffffffffffec
    x8: 0x000000000c000000   x9: 0x0000000004000000  x10: 0x000000000000000b  x11: 0x000000000000000b
   x12: 0x0000000000000010  x13: 0x000000018c6c9c0e  x14: 0x0000030000000300  x15: 0x0000000000000000
   x16: 0x0000000000000148  x17: 0x0000000000000000  x18: 0x0000000000000000  x19: 0x0000000000000006
   x20: 0x000000016de9b000  x21: 0x000000016de9a850  x22: 0x00000001700ff380  x23: 0x0000000000000004
   x24: 0x00000001b1ebd400  x25: 0x0000000000000000  x26: 0x00000001b1ebd400  x27: 0x000000016de9b0e0
   x28: 0x0000000000000000   fp: 0x000000016de9a7b0   lr: 0x000000018b543334
    sp: 0x000000016de9a790   pc: 0x000000018b479014 cpsr: 0x00000000

最佳答案

我建议仔细检查您没有与 UIAlertController(或任何其他 UIKit API)主线程(又名 Thread 0 上面)。许多 UIKit API 被设计为在主线程中使用。

值得注意的是,崩溃发生在 线程 1 上……

如果您有疑问,请用以下内容结束调用:

DispatchQueue.main.async {
    // Call UIAlertController code here...
}

关于ios - 解读iOS崩溃日志与-[UIApplication _cachedSystemAnimationFenceCreatingIfNecessary :],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43873503/

相关文章:

ios - 我想导航到 webview 中的另一个文件。

iphone - UINavigationController 不工作

ios - 当只有一个单元格时,单元格位于 Collection View 的中心

multithreading - Scala - 可变线程安全集合

python线程安全的可变对象副本

ios - 在 Flutter 中显示适用于 iOS 的 PDF 内联文件

swift - 根据父 UITableVIew 的节索引设置嵌套 UITableView 的行数

ios - 如何知道一个 Realm 对象是否更新成功?

ios - 在 Swift 中获取设备方向

scala - Scala 中仅更新单个 var 线程的类实例安全吗?