异常类型:一个用户的 SIGTRAP

Exception Type: SIGTRAP for one user

我不断收到单个测试用户针对 Swift 项目的崩溃日志 header:

Exception Type: SIGTRAP

这是崩溃日志的完整相关部分:

Hardware Model:      iPad4,2
Process:         Jam Session [204]
Path:            /var/mobile/Containers/Bundle/Application/FADFF299-ABDC-46AA-8B77-BF4F77301DBF/Jam Session.app/Jam Session
Identifier:      it.info.music.jamsession
Version:         1.0 (1.0.8)
Code Type:       ARM-64
Parent Process:  ??? [1]

Date/Time:       2016-02-26 11:06:46 +0000
OS Version:      iPhone OS 9.2.1 (13D15)
Report Version:  104

Exception Type:  SIGTRAP
Exception Codes: #0 at 0x10002971c
Crashed Thread:  0

Thread 0 Crashed:
0   Jam Session                         0x000000010002971c 0x10000c000 + 120604
1   Jam Session                         0x0000000100023ee4 0x10000c000 + 98020
2   UIKit                               0x0000000187af931c 0x187794000 + 3560220
3   UIKit                               0x0000000187af9484 0x187794000 + 3560580
4   UIKit                               0x0000000187ae87e8 0x187794000 + 3491816
5   UIKit                               0x0000000187afdfb0 0x187794000 + 3579824
6   UIKit                               0x000000018789308c 0x187794000 + 1044620
7   UIKit                               0x00000001877a3778 0x187794000 + 63352
8   QuartzCore                          0x00000001851b2b2c 0x1851a4000 + 60204
9   QuartzCore                          0x00000001851ad738 0x1851a4000 + 38712
10  UIKit                               0x00000001877ba454 0x187794000 + 156756
11  UIKit                               0x000000018786820c 0x187794000 + 868876
12  UIKit                               0x0000000187865be4 0x187794000 + 859108
13  UIKit                               0x000000018787e7dc 0x187794000 + 960476
14  UIKit                               0x000000018787e4c8 0x187794000 + 959688
15  UIKit                               0x000000018787e1d0 0x187794000 + 958928
16  UIKit                               0x00000001877e2e90 0x187794000 + 323216
17  UIKit                               0x00000001877e110c 0x187794000 + 315660
18  UIKit                               0x0000000187871cec 0x187794000 + 908524
19  UIKit                               0x00000001878678c0 0x187794000 + 866496
20  UIKit                               0x0000000187866a6c 0x187794000 + 862828
21  UIKit                               0x0000000187866694 0x187794000 + 861844
22  UIKit                               0x00000001878665fc 0x187794000 + 861692
23  UIKit                               0x00000001877a3778 0x187794000 + 63352
24  QuartzCore                          0x00000001851b2b2c 0x1851a4000 + 60204
25  QuartzCore                          0x00000001851ad738 0x1851a4000 + 38712
26  QuartzCore                          0x00000001851ad5f8 0x1851a4000 + 38392
27  QuartzCore                          0x00000001851acc94 0x1851a4000 + 35988
28  QuartzCore                          0x00000001851ac9dc 0x1851a4000 + 35292
29  QuartzCore                          0x00000001851a60cc 0x1851a4000 + 8396
30  CoreFoundation                      0x0000000182a6c588 0x182990000 + 902536
31  CoreFoundation                      0x0000000182a6a32c 0x182990000 + 893740
32  CoreFoundation                      0x00000001829996a0 0x182990000 + 38560
33  UIKit                               0x0000000187816580 0x187794000 + 533888
34  UIKit                               0x0000000187810d90 0x187794000 + 511376
35  Jam Session                         0x0000000100016cb8 0x10000c000 + 44216
36  libdyld.dylib                       0x000000018253a8b8 0x182538000 + 10424

我亲眼目睹了用户 iPad 的崩溃,奇怪的是,在崩溃之后,即使单击主页按钮,应用程序仍然锁定在应用程序的初始屏幕上。

如果我尝试符号化我自己项目中的任何条目,我会得到:

 atos cannot load symbols for the file 3rdparty for architecture arm64.

我的应用程序或用户设备是否有问题我可以帮助他修复?

谢谢

这是我最好的猜测。来自 Apple 文档:

Trace Trap [EXC_BREAKPOINT // SIGTRAP]

Similar to an Abnormal Exit, this exception is intended to give an attached debugger the chance to interrupt the process at a specific point in its execution. You can trigger this exception from your own code using the __builtin_trap() function. If no debugger is attached, the process is terminated and a crash report is generated.

Swift code will terminate the program with this exception type if it detects an unexpected condition at runtime such as:

  • a non-optional type with a nil value
  • a failed forced type conversion

Look at the Backtrace of the crashed thread to determine where the unexpected condition was encountered. Additional information may have also been logged to the device's console.

根据我的经验,我发现以上内容是正确的。当我对可选选项草率时(例如,使用 as! 强制转换或没有正确使用可选绑定),我经常遇到异步(网络 - 在我的例子中)操作的问题。

此外,为了符号化,您应该使用 AppStore 构建和 .dSYM 文件(iTunes Connect 提交的存档)。

满link https://developer.apple.com/library/ios/technotes/tn2151/_index.html

问题是由于显示的 tableCell 内部崩溃所致。发生这种情况时,调试器通常非常讨厌。无论如何,我在 Xcode 中发现了一个我不知道的选项,用于查看来自其他设备的崩溃位置的中间代码符号。我发现它引用了我的 类 之一中显示的单元格,因此将我指向该错误。