仅限生产版本的EXC_BREAKPOINT(SIGTRAP)

时间:2016-09-17 12:43:00

标签: ios swift xcode

我的iOS应用程序在测试中运行良好,但在启动时使用从App Store下载的发行版本崩溃。我尝试使用Xcode中的发布版本配置进行重新测试,它不会崩溃,只是商店版本。我很确定它与应用内购买产品加载有关,但由于无法在测试环境中复制它并且无法读取日志,因此无法缩小范围。设备日志显示如下:

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000000e7ffdefe
Triggered by Thread:  5

Filtered syslog:
None found

Global Trace Buffer (reverse chronological seconds):
1.456537     CFNetwork                  0x0000000025b13755 TCP Conn 0x16696ed0 SSL Handshake DONE
1.507619     CFNetwork                  0x0000000025b13755 TCP Conn 0x16697670 SSL Handshake DONE
1.618210     CFNetwork                  0x0000000025b1368f TCP Conn 0x16696ed0 starting SSL negotiation
1.619545     CFNetwork                  0x0000000025b1368f TCP Conn 0x16697670 starting SSL negotiation
1.619545     CFNetwork                  0x0000000025b9387d TCP Conn 0x16696ed0 complete. fd: 12, err: 0
1.620001     CFNetwork                  0x0000000025b9387d TCP Conn 0x16697670 complete. fd: 10, err: 0
1.621124     CFNetwork                  0x0000000025b94977 TCP Conn 0x16696ed0 event 1. err: 0
1.622355     CFNetwork                  0x0000000025b94977 TCP Conn 0x16697670 event 1. err: 0
1.699555     CFNetwork                  0x0000000025b949f5 TCP Conn 0x16697670 started
1.699555     CFNetwork                  0x0000000025b949f5 TCP Conn 0x16696ed0 started
1.757512     CFNetwork                  0x0000000025b13755 TCP Conn 0x16684640 SSL Handshake DONE
2.136019     CFNetwork                  0x0000000025b1368f TCP Conn 0x16684640 starting SSL negotiation
2.136958     CFNetwork                  0x0000000025b9387d TCP Conn 0x16684640 complete. fd: 5, err: 0
2.139006     CFNetwork                  0x0000000025b94977 TCP Conn 0x16684640 event 1. err: 0
2.400334     CFNetwork                  0x0000000025b949f5 TCP Conn 0x16684640 started
2.412851     CFNetwork                  0x0000000025bda15f Creating default cookie storage with default identifier
2.412851     CFNetwork                  0x0000000025bda13b Faulting in CFHTTPCookieStorage singleton
2.412851     CFNetwork                  0x0000000025c1c7bf Faulting in NSHTTPCookieStorage singleton



Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0:
0   libsystem_kernel.dylib          0x2528a8d0 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x2528a6d4 mach_msg + 40
2   CoreFoundation                  0x255d5ac4 __CFRunLoopServiceMachPort + 136
3   CoreFoundation                  0x255d3e4c __CFRunLoopRun + 1036
4   CoreFoundation                  0x25523228 CFRunLoopRunSpecific + 520
5   CoreFoundation                  0x25523014 CFRunLoopRunInMode + 108
6   GraphicsServices                0x26b13ac8 GSEventRunModal + 160
7   UIKit                           0x29bf7188 UIApplicationMain + 144
8   LeaseLocator_2016               0x000bfe88 0x53000 + 446088
9   libdyld.dylib                   0x251cb872 start + 2

Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0   libsystem_kernel.dylib          0x252a02f8 kevent_qos + 24
1   libdispatch.dylib               0x25195d60 _dispatch_mgr_invoke + 256
2   libdispatch.dylib               0x25195abe _dispatch_mgr_thread$VARIANT$mp + 38

Thread 2:
0   libsystem_kernel.dylib          0x2529f864 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x25345b34 _pthread_wqthread + 1036
2   libsystem_pthread.dylib         0x25345718 start_wqthread + 8

Thread 3:
0   libsystem_kernel.dylib          0x2529f864 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x25345b34 _pthread_wqthread + 1036
2   libsystem_pthread.dylib         0x25345718 start_wqthread + 8

Thread 4:
0   libsystem_kernel.dylib          0x2529f864 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x25345b34 _pthread_wqthread + 1036
2   libsystem_pthread.dylib         0x25345718 start_wqthread + 8

Thread 5 name:  Dispatch queue: NSOperationQueue 0x1666ba80 :: NSOperation 0x165dafe0 (QOS: LEGACY)
Thread 5 Crashed:
0   LeaseLocator_2016               0x00079894 0x53000 + 157844
1   LeaseLocator_2016               0x00073d90 0x53000 + 134544
2   LeaseLocator_2016               0x000788d0 0x53000 + 153808
3   CFNetwork                       0x25b1b280 __75-[__NSURLSessionLocal taskForClass:request:uploadFile:bodyData:completion:]_block_invoke + 16
4   CFNetwork                       0x25b2aa6a __49-[__NSCFLocalSessionTask _task_onqueue_didFinish]_block_invoke + 278
5   Foundation                      0x25e25678 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 8
6   Foundation                      0x25d865f2 -[NSBlockOperation main] + 146
7   Foundation                      0x25d78bc8 -[__NSOperationInternal _start:] + 768
8   Foundation                      0x25e27930 __NSOQSchedule_f + 192
9   libdispatch.dylib               0x2518e422 _dispatch_queue_drain$VARIANT$mp + 1758
10  libdispatch.dylib               0x2518da60 _dispatch_queue_invoke$VARIANT$mp + 284
11  libdispatch.dylib               0x2519015c _dispatch_root_queue_drain + 396
12  libdispatch.dylib               0x2518ffcc _dispatch_worker_thread3 + 96
13  libsystem_pthread.dylib         0x25345b28 _pthread_wqthread + 1024
14  libsystem_pthread.dylib         0x25345718 start_wqthread + 8

Thread 6:
0   libsystem_kernel.dylib          0x2529f864 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x25345b34 _pthread_wqthread + 1036
2   libsystem_pthread.dylib         0x25345718 start_wqthread + 8

Thread 7:
0   libsystem_pthread.dylib         0x25345710 start_wqthread + 0

Thread 8 name:  com.apple.NSURLConnectionLoader
Thread 8:
0   libsystem_kernel.dylib          0x2528a8d0 mach_msg_trap + 20
1   libsystem_kernel.dylib          0x2528a6d4 mach_msg + 40
2   CoreFoundation                  0x255d5ac4 __CFRunLoopServiceMachPort + 136
3   CoreFoundation                  0x255d3e4c __CFRunLoopRun + 1036
4   CoreFoundation                  0x25523228 CFRunLoopRunSpecific + 520
5   CoreFoundation                  0x25523014 CFRunLoopRunInMode + 108
6   CFNetwork                       0x25b749f6 +[NSURLConnection(Loader) _resourceLoadLoop:] + 486
7   Foundation                      0x25e3d4a4 __NSThread__start__ + 1148
8   libsystem_pthread.dylib         0x2534785a _pthread_body + 138
9   libsystem_pthread.dylib         0x253477ce _pthread_start + 110
10  libsystem_pthread.dylib         0x25345724 thread_start + 8

Thread 9 name:  com.apple.CFSocket.private
Thread 9:
0   libsystem_kernel.dylib          0x2529eeec __select + 20
1   CoreFoundation                  0x255daf12 __CFSocketManager + 566
2   libsystem_pthread.dylib         0x2534785a _pthread_body + 138
3   libsystem_pthread.dylib         0x253477ce _pthread_start + 110
4   libsystem_pthread.dylib         0x25345724 thread_start + 8

Thread 5 crashed with ARM Thread State (32-bit):
    r0: 0x00000000    r1: 0x402190b0      r2: 0x00000000      r3: 0x00000000
    r4: 0x165d5790    r5: 0x00421c86      r6: 0x00000000      r7: 0x40218b48
    r8: 0x16696b50    r9: 0x16696b54     r10: 0x00000001     r11: 0x00000000
    ip: 0x000d3274    sp: 0x40218a80      lr: 0x00078c08      pc: 0x00079894
  cpsr: 0x60000010

我是否可以通过某种方式测试商店的生产版本,或者此日志是否提供了足够的信息来确定错误的位置?

2 个答案:

答案 0 :(得分:0)

几个星期前我遇到了同样的问题,并且无法测试它是非常令人沮丧的。我所做的虽然不是一个完美的解决方案,却允许我测试这个问题。

进入项目的Build Settings,然后进入Signing。代码签名身份下的所有字段都应该说是" iOS Developer"。将它们全部更改为iOS Distribution。构建并运行您的应用程序,它应该会崩溃。现在,您将能够通过Xcode找出正在发生的事情。

此外,一旦您解决了问题,请确保将这些代码签名身份恢复正常。

答案 1 :(得分:0)

检查您是否在应用程序中联系了联系人,日历,提醒,照片,蓝牙共享,麦克风,相机,位置,健康,HomeKit,媒体库,动作,CallKit,语音识别,SiriKit,电视提供商等。

自iOS 10起,如果您尝试在没有使用说明的情况下访问隐私敏感数据,您的应用就会崩溃。

为避免崩溃,您需要将密钥添加到“Info.plist”,例如:

Privacy - Camera Usage Description
Privacy - Photo Library Usage Description

在我的情况下,我添加了相机使用的密钥,但没有添加麦克风,并且遇到了同样的问题。