【问题标题】:iOS - Can't trace this crash erroriOS - 无法追踪此崩溃错误
【发布时间】:2016-01-25 18:42:40
【问题描述】:

我使用的是 Crashlytics 3.6.0,最近收到了一些我无法阅读/理解的崩溃报告。它们似乎只发生在 iOS 8 上(虽然不能 100% 确认)。

Thread : Crashed: com.apple.main-thread
0  libobjc.A.dylib                0x197fcfbd0 objc_msgSend + 16
1  UIKit                          0x18c035c60 -[UIControl _sendActionsForEvents:withEvent:] + 124
2  UIKit                          0x18c293e7c -[UISwitch _handleLongPressNL:] + 424
3  UIKit                          0x18c1af508 _UIGestureRecognizerSendActions + 276
4  UIKit                          0x18c048050 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 580
5  UIKit                          0x18c4b420c ___UIGestureRecognizerUpdate_block_invoke662 + 60
6  UIKit                          0x18c00c530 _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 292
7  UIKit                          0x18c00a8dc _UIGestureRecognizerUpdate + 2504
8  UIKit                          0x18c0461f8 -[UIWindow _sendGesturesForEvent:] + 1044
9  UIKit                          0x18c045898 -[UIWindow sendEvent:] + 660
10 UIKit                          0x18c018fa8 -[UIApplication sendEvent:] + 264
11 infinight                      0x1003ebe00 -[IBGMethodSwizzler sendEvent:] (IBGMethodSwizzler.m:103)
12 UIKit                          0x18c2b7f58 _UIApplicationHandleEventFromQueueEvent + 14992
13 UIKit                          0x18c017510 _UIApplicationHandleEventQueue + 1616
14 CoreFoundation                 0x18781e9ec __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
15 CoreFoundation                 0x18781dc90 __CFRunLoopDoSources0 + 264
16 CoreFoundation                 0x18781bd40 __CFRunLoopRun + 712
17 CoreFoundation                 0x1877490a4 CFRunLoopRunSpecific + 396
18 GraphicsServices               0x1908eb5a4 GSEventRunModal + 168
19 UIKit                          0x18c07e3c0 UIApplicationMain + 1488
20 infinight                      0x10013af44 main (main.m:16)
21 libdyld.dylib                  0x19862aa08 start + 4

谁能帮我找出错误?我无法重现该错误——它不会发生在我的设备或模拟器上。但在过去的几天里,我从测试用户那里收到了大量类似的崩溃报告。

【问题讨论】:

  • 首先使用 IBGMethodSwizzler.m 的第 103 行附近的相关代码更新您的问题。
  • "objc_msgSend" 是一个很好的指标,表明您正在尝试向某个不再存在的对象发送消息。也许您可以通过知道UISwitch 连接到什么来跟踪它。如果您正在交换方法实现(swizzle),那可能会指出问题所在。
  • 你完全正确@PhillipMills!我设法通过安装 iOS 8.1 模拟器并启用 Zombie Objects 来追踪错误。我究竟做错了什么?我在最后更新了问题
  • 我的下一步是使用 Instruments 来跟踪分配历史并查看意外释放的位置。 (或者,根据 NamedUISwitch 的创建和使用方式,您可能会发现这一点很明显。)
  • 我只是在 TableView 的每个 Cell 中分配、初始化 NamedUISwitch,因此创建了多个实例。我该如何处理?为什么 iOS 9 上不会发生这种崩溃?

标签: ios crash-reports crashlytics


【解决方案1】:

这是一个仅在 iOS 8 上出现的错误。为了重现该错误,我下载了 iOS 8.1 模拟器并发现了该错误。为了得到确切的错误信息,我去了 Edit Scheme 和 Enabled Zombie Objects。这向我显示了确切的错误消息:

*** -[NamedUISwitch _sendActionsForEvents:withEvent:]: message sent to deallocated instance

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-11-05
    • 1970-01-01
    • 2012-06-12
    • 1970-01-01
    • 2021-09-30
    • 1970-01-01
    • 2011-06-16
    相关资源
    最近更新 更多