如何理解连接到 Xcode 的设备的 ios 崩溃报告?

How to make sense of ios Crash Report from a device connected to Xcode?

我有一个通过审核但在生产中崩溃的生产应用程序。我已将设备连接到 Xcode 并复制了崩溃并从 Xcode 检索了崩溃日志。问题是,我不理解报告。对我来说完全是无稽之谈。例如,它不会告诉我应用程序崩溃的代码中的哪一行。我的问题是,这是 'un-symbolicated' 崩溃报告的示例吗?在我什至考虑弄清楚如何符号化崩溃报告之前,我不知道符号化和非符号化的报告是什么样的....

根据 apple 文档(Apple Docuemtnation, under Introduction section),因为我从 xcode 检索到崩溃报告,它应该会在几秒钟内自动符号化???如果这份报告是象征性的,那对我来说毫无意义。很无益。

 Incident Identifier: 8CAEC9EB-016F-42DC-AEB7-DE0EC136F33A
 CrashReporter Key:   26676d619a8d0376d5040dfe66f618918964f4d4
 Hardware Model:      iPhone7,1
 Process:             mapdocuments [427]
 Path:                
 /private/var/containers/Bundle/Application/AFB5062A-C2A8-4106- 8A28-5B0528918E2D/mapdocuments.app/mapdocuments
 Identifier:          com.xxxxx.mapdocuments
 Version:             13 (1)
 AppStoreTools:       10B63
 AppVariant:          1:iPhone7,1:12
 Code Type:           ARM-64 (Native)
 Role:                Non UI
 Parent Process:      launchd [1]
 Coalition:           com.xxxxx.mapdocuments [513]


 Date/Time:           2019-03-28 01:52:16.3749 +0000
 Launch Time:         2019-03-28 01:51:08.0437 +0000
 OS Version:          iPhone OS 12.1.4 (16D57)
 Baseband Version:    7.32.00
 Report Version:      104

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

 Application Specific Information:
 abort() called

Last Exception Backtrace:
 0   CoreFoundation                 0x1a4531ea4 
 __exceptionPreprocess + 228
 1   libobjc.A.dylib                0x1a3701a50 
objc_exception_throw + 55
 2   CoreFoundation                 0x1a4438484 +[NSException 
 raise:format:] + 115
 3   StoreKit                       0x1b860fc14 -[SKPaymentQueue 
 addPayment:] + 675
 4   mapdocuments                   0x100e5c1e8 0x100dfc000 + 
 393704
 5   mapdocuments                   0x100e65ddc 0x100dfc000 + 
 433628
 6   UIKitCore                      0x1d16d2314 -[UIApplication 
 sendAction:to:from:forEvent:] + 95
 7   UIKitCore                      0x1d115fd54 -[UIControl 
 sendAction:to:forEvent:] + 79
 8   UIKitCore                      0x1d1160074 -[UIControl 
 _sendActionsForEvents:withEvent:] + 439
 9   UIKitCore                      0x1d115f074 -[UIControl 
 touchesEnded:withEvent:] + 567
 10  UIKitCore                      0x1d170ba6c -[UIWindow 
 _sendTouchesForEvent:] + 2471
 11  UIKitCore                      0x1d170ccd0 -[UIWindow 
 sendEvent:] + 3155
 12  UIKitCore                      0x1d16ebfcc -[UIApplication 
 sendEvent:] + 339
 13  UIKitCore                      0x1d17bae38 
 __dispatchPreprocessedEventFromEventQueue + 1619
 14  UIKitCore                      0x1d17bd830 
 __handleEventQueueInternal + 4739
 15  UIKitCore                      0x1d17b6320 
 __handleHIDEventFetcherDrain + 151
 16  CoreFoundation                 0x1a44c20e0 
 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 23
 17  CoreFoundation                 0x1a44c2060 
 __CFRunLoopDoSource0 + 87
 18  CoreFoundation                 0x1a44c1944 
 __CFRunLoopDoSources0 + 175
 19  CoreFoundation                 0x1a44bc810 __CFRunLoopRun + 
 1039
 20  CoreFoundation                 0x1a44bc0e0 
 CFRunLoopRunSpecific + 435
 21  GraphicsServices               0x1a6735584 GSEventRunModal + 
 99
 22  UIKitCore                      0x1d16d0c00 UIApplicationMain + 
 211
 23  mapdocuments                   0x100e02884 0x100dfc000 + 26756
 24  libdyld.dylib                  0x1a3f7abb4 start + 3


 Thread 0 name:  Dispatch queue: com.apple.main-thread
 Thread 0 Crashed:
 0   libsystem_kernel.dylib         0x00000001a40c7104 
 __pthread_kill + 8
 1   libsystem_pthread.dylib        0x00000001a4143020 
 pthread_kill$VARIANT$mp + 380
 2   libsystem_c.dylib              0x00000001a401ed78 abort + 140
 3   libc++abi.dylib                0x00000001a36e8f78 
 __cxa_bad_cast + 0
 4   libc++abi.dylib                0x00000001a36e9120 
 default_unexpected_handler+ 8480 () + 0
 5   libobjc.A.dylib                0x00000001a3701e58 
 _objc_terminate+ 28248 () + 124
 6   libc++abi.dylib                0x00000001a36f50fc 
 std::__terminate(void (*)+ 57596 ()) + 16
 7   libc++abi.dylib                0x00000001a36f4cec _ 
 _cxa_rethrow + 144
 8   libobjc.A.dylib                0x00000001a3701c20 
 objc_exception_rethrow + 44
 9   CoreFoundation                 0x00000001a44bc14c 
 CFRunLoopRunSpecific + 544
 10  GraphicsServices               0x00000001a6735584 
 GSEventRunModal + 100
  11  UIKitCore                         0x00000001d16d0c00 
 UIApplicationMain + 212
 12  mapdocuments                   0x0000000100e02884 0x100dfc000 
 + 26756
 13  libdyld.dylib                  0x00000001a3f7abb4 start + 4

在 Xode 中查看:

是的,这是一个未符号化的崩溃日志。问题是对 [-SKPaymentQueue addPayment:] 的调用传递了错误的付款指针。以下是日志告诉您的内容:

Exception Type: EXC_CRASH (SIGABRT)

Application Specific Information:

abort() called

这些表明某些代码明确调用了函数来中止 运行 应用程序。发生这种情况是因为 OS 检测到向函数提供了一些错误数据,并且它确定无法继续使用错误数据,因此它唯一的选择是中止。

回溯显示调用了哪些函数以中止:

Last Exception Backtrace:
 0   CoreFoundation                 0x1a4531ea4 __exceptionPreprocess + 228
 1   libobjc.A.dylib                0x1a3701a50 objc_exception_throw + 55
 2   CoreFoundation                 0x1a4438484 +[NSException raise:format:] + 115
 3   StoreKit                       0x1b860fc14 -[SKPaymentQueue addPayment:] + 675
 4   mapdocuments                   0x100e5c1e8 0x100dfc000 + 393704
 5   mapdocuments                   0x100e65ddc 0x100dfc000 + 433628

它们的调用顺序相反。因此 mapdocuments 应用程序或库中的一些代码调用了 StoreKit 框架,特别是 -[SKPaymentQueue addPayment:] 方法。该方法发现传入的值无效并引发异常。使用 @try/@catch 块未捕获异常,因此 OS 中止执行。

不幸的是,因为没有提供符号,我们不知道用错误​​数据调用 -addPayment: 的确切行。但是,如果您构建了该应用程序,则应该有它的符号,我认为可以使用这些符号来表示崩溃日志。不过我自己没做过。