代码之家  ›  专栏  ›  技术社区  ›  Fabrizio Bartolomucci

异常类型:一个用户的SIGTRAP

  •  4
  • Fabrizio Bartolomucci  · 技术社区  · 9 年前

    我一直在接收单个测试用户针对Swift项目的崩溃日志,标题为:

    异常类型:SIGTRAP

    这是crashlog的相关部分:

    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.
    

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

    谢谢

    2 回复  |  直到 9 年前
        1
  •  7
  •   Eppilo    9 年前

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

    跟踪陷阱[EXC_BREAKPOINT//SIGTRAP]

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

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

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

    查看崩溃线程的回溯,以确定 遇到意外情况。其他信息可能有 也被记录到设备的控制台。

    根据我的经验,我发现以上是正确的。当我对选项(例如,强制转换 as! 或未正确使用可选绑定)。

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

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

        2
  •  0
  •   Fabrizio Bartolomucci    9 年前

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