ios - 如何阅读此 iOS 堆栈跟踪?

标签 ios objective-c swift react-native stack-trace

我通常使用 Javascript 和 Python 等高级语言进行开发,因此在阅读较低级别的堆栈跟踪方面我没有那么丰富的经验。我正在使用 React Native 构建一个 iOS 应用程序,我的应用程序有时会意外崩溃。阅读崩溃日志,这是我得到的:

Incident Identifier: B03D5F95-EFD1-4FEB-AE18-C8EFEF273E53
CrashReporter Key:   6049c1cc93a2e0163265631aa6cc2fd30a1af6e7
Hardware Model:      iPhone7,2
Process:             MyApp [24268]
Path:                /private/var/containers/Bundle/Application/99B2B9A1-D266-4222-A083-84C4CFFCE182/MyApp.app/MyApp
Identifier:          org.mycompany.MyApp
Version:             1 (1.0)
Code Type:           ARM-64 (Native)
Role:                Non UI
Parent Process:      launchd [1]
Coalition:           org.mycompany.MyApp [3119]


Date/Time:           2019-03-04 14:20:18.4924 +0800
Launch Time:         2019-03-04 14:09:15.2536 +0800
OS Version:          iPhone OS 11.0.3 (15A432)
Baseband Version:    6.17.00
Report Version:      104

Exception Type:  EXC_CRASH (SIGKILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: Namespace <0xF>, Code 0x8badf00d
Triggered by Thread:  0

Filtered syslog:
None found

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x0000000180a60bc4 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x0000000180a60a3c mach_msg + 72
2   BackBoardServices               0x00000001835d0de0 _BKSHIDGetCurrentDisplayBrightness + 112
3   BackBoardServices               0x00000001835de9cc BKSDisplayBrightnessGetCurrent + 32
4   FrontBoardServices              0x00000001835fffc0 -[FBSUIApplicationSystemService currentBacklightLevel] + 12
5   UIKit                           0x000000018a8a3d44 -[UIDevice _backlightLevel] + 44
6   UIKit                           0x000000018a8aced4 -[UIScreen _postBrightnessDidChangeNotificationIfAppropriate] + 168
7   CoreFoundation                  0x0000000180efa12c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
8   CoreFoundation                  0x0000000180efa090 ___CFXRegistrationPost_block_invoke + 64
9   CoreFoundation                  0x0000000180f1016c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20
10  CoreFoundation                  0x0000000180f0fa3c __CFRunLoopDoBlocks + 288
11  CoreFoundation                  0x0000000180f0dca4 __CFRunLoopRun + 2436
12  CoreFoundation                  0x0000000180e2e2d8 CFRunLoopRunSpecific + 436
13  GraphicsServices                0x0000000182cbff84 GSEventRunModal + 100
14  UIKit                           0x000000018a3db880 UIApplicationMain + 208
15  MyApp                           0x00000001005833d4 main + 29652 (main.m:14)
16  libdyld.dylib                   0x000000018095256c start + 4

我如何/从哪里开始阅读这个崩溃日志?我相信它与 mach_msg_trap 有关,但我无法找到任何相关信息。在某些情况下,我的应用程序是一个使用后台地理位置跟踪来跟踪用户地理位置的应用程序。我无法找出导致崩溃的原因。

最佳答案

参见 TN2141: Understanding and Analyzing Application Crash Reports ,它说:

The exception code 0x8badf00d indicates that an application has been terminated by iOS because a watchdog timeout occurred. The application took too long to launch, terminate, or respond to system events. ... Whatever operation is on Thread 0 needs to be moved to a background thread, or processed differently, so that it does not block the main thread.

您是否正在做任何可能长时间阻塞主线程的事情?

关于ios - 如何阅读此 iOS 堆栈跟踪?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54981368/

相关文章:

ios - 为什么 NSAttributedString 不继承 NSString ? NSAttributedString 的父类是 NSObject 为什么?

ios - UIScrollView 增加内容并居中

swift - SwiftUI 中的旋转木马/侧边栏列表样式

c++ - (iOS) 如何从 C++ 应用程序获取 UIViewController?

ios - 当用户从照片库中选择一张时图像会旋转

swift - Alamofire:是否有像 AFNetworkingOperationDidFinishNotification 这样的通知?

iphone - 具有项目间间距的 ​​UICollectoinView 水平滚动

ios - 在下载时从 NSURLSessionDownloadTask 访问字节

ios - UIView 中的动态 UILabel 增加内存

ios - 使用 SVGKit 渲染带有嵌入式 Base64 编码的 png 图像的 SVG 需要相当大的内存