【问题标题】:Exception Type: SIGTRAP for one user异常类型:一个用户的 SIGTRAP
【发布时间】:2016-06-09 18:03:47
【问题描述】:

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

异常类型: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.

这是我的应用程序或用户设备中的问题,我可以帮助他解决吗?

谢谢

【问题讨论】:

    标签: ios swift crash crash-reports


    【解决方案1】:

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

    跟踪陷阱 [EXC_BREAKPOINT // SIGTRAP]

    类似于异常退出,此异常旨在提供 附加的调试器有机会在特定的地方中断进程 指向它的执行。您可以自己触发此异常 使用 __builtin_trap() 函数的代码。如果没有附加调试器, 进程终止并生成崩溃报告。

    Swift 代码将终止具有这种异常类型的程序,如果它 在运行时检测到意外情况,例如:

    • 具有 nil 值的非可选类型
    • 强制类型转换失败

    查看崩溃线程的 Backtrace 以确定 遇到了意想不到的情况。附加信息可能有 也被记录到设备的控制台。

    根据我的经验,我发现上述情况属实。当我对可选选项马虎时(例如,使用as! 强制转换或未正确使用可选绑定),我经常遇到异步(网络 - 在我的情况下)操作的问题。

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

    完整链接 https://developer.apple.com/library/ios/technotes/tn2151/_index.html

    【讨论】:

    • 好答案。就我而言,这是一个溢出异常。 (NSNotFound + 1)
    【解决方案2】:

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

    【讨论】:

    • 什么是错误?
    • 你在说 Xcode 中的哪个选项?
    猜你喜欢
    • 2012-08-01
    • 2020-12-15
    • 2018-02-04
    • 1970-01-01
    • 2011-02-06
    • 2018-12-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多