我有一个应用程序在testflight中向少数用户发布,并且已经报告了各种崩溃,其中大多数指向崩溃日志下面。我无法重现崩溃,所以,我试图通过崩溃日志确定可能导致崩溃的位置。下面是崩溃日志以及它指向崩溃的方法。
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001001c8e9c
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [0]
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 My App 0x00000001001c8e9c specialized MyTableViewController.didUpdateText(MyTableViewCell, withText : String) -> () + 1008 (MyTableViewController.swift:0)
1 My App 0x00000001001c11b4 @objc MyTableViewController.didUpdateText(MyTableViewCell, withText : String) -> () + 92 (MyTableViewController.swift:0)
2 My App 0x00000001001c1234 protocol witness for MyTableViewCellDelegate.didUpdateText(MyTableViewCell, withText : String) -> () in conformance MyTableViewController + 92 (MyTableViewController.swift:0)
3 My App 0x00000001001f0550 specialized MyTableViewCell.textViewDidEndEditing(UITextView) -> () + 380 (MyTableViewCell.swift:225)
4 My App 0x00000001001ef0cc @objc MyTableViewCell.textViewDidChange(UITextView) -> () + 52
5 UIKit 0x00000001924a7ca0 -[UITextView resignFirstResponder] + 252 (UITextView.m:2151)
6 UIKit 0x00000001924dc39c -[UITableView reloadData] + 328 (UITableView.m:5116)
7 My App 0x00000001001bdcec MyTableViewController.loadDetailsView() -> () + 1040 (MyTableViewController.swift:220)
8 My App 0x000000010017a4b0 MainViewController.loadDetailsView() -> () + 132 (MainViewController.swift:234)
9 My App 0x000000010017a54c @objc MainViewController.loadDetailsView() -> () + 28 (MainViewController.swift:0)
10 My App 0x00000001000edcbc __58-[DisplayViewController createNewInstanceForUser]_block_invoke + 120 (DisplayViewController.m:1221)
11 libdispatch.dylib 0x000000018b18a9e0 _dispatch_call_block_and_release + 24 (init.c:963)
12 libdispatch.dylib 0x000000018b18a9a0 _dispatch_client_callout + 16 (object.m:473)
13 libdispatch.dylib 0x000000018b18f5e8 _dispatch_main_queue_callback_4CF + 996 (inline_internal.h:2431)
14 CoreFoundation 0x000000018c2810c8 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 (CFRunLoop.c:1793)
15 CoreFoundation 0x000000018c27ece4 __CFRunLoopRun + 1572 (CFRunLoop.c:3004)
16 CoreFoundation 0x000000018c1aeda4 CFRunLoopRunSpecific + 424 (CFRunLoop.c:3113)
17 GraphicsServices 0x000000018dc19074 GSEventRunModal + 100 (GSEvent.c:2245)
18 UIKit 0x0000000192462c9c UIApplicationMain + 208 (UIApplication.m:4089)
19 My App 0x000000010013f978 main + 92 (main.m:14)
20 libdyld.dylib 0x000000018b1bd59c start + 4
Thread 1 name:
Thread 1:
0 libsystem_kernel.dylib 0x000000018b2af224 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x000000018b2af09c mach_msg + 72 (mach_msg.c:103)
2 CoreFoundation 0x000000018c280e90 __CFRunLoopServiceMachPort + 192 (CFRunLoop.c:2527)
3 CoreFoundation 0x000000018c27eae4 __CFRunLoopRun + 1060 (CFRunLoop.c:2870)
4 CoreFoundation 0x000000018c1aeda4 CFRunLoopRunSpecific + 424 (CFRunLoop.c:3113)
5 Foundation 0x000000018ccc9db4 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304 (NSRunLoop.m:367)
6 Foundation 0x000000018cceab84 -[NSRunLoop(NSRunLoop) runUntilDate:] + 96 (NSRunLoop.m:411)
7 UIKit 0x0000000192dec830 -[UIEventFetcher threadMain] + 136 (UIEventFetcher.m:313)
8 Foundation 0x000000018cdc7318 __NSThread__start__ + 996 (NSThread.m:1163)
9 libsystem_pthread.dylib 0x000000018b39568c _pthread_body + 240 (pthread.c:697)
10 libsystem_pthread.dylib 0x000000018b39559c _pthread_start + 284 (pthread.c:744)
11 libsystem_pthread.dylib 0x000000018b392cb4 thread_start + 4
Thread 2 name:
Thread 2:
0 libsystem_kernel.dylib 0x000000018b2af224 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x000000018b2af09c mach_msg + 72 (mach_msg.c:103)
2 CoreFoundation 0x000000018c280e90 __CFRunLoopServiceMachPort + 192 (CFRunLoop.c:2527)
3 CoreFoundation 0x000000018c27eae4 __CFRunLoopRun + 1060 (CFRunLoop.c:2870)
4 CoreFoundation 0x000000018c1aeda4 CFRunLoopRunSpecific + 424 (CFRunLoop.c:3113)
5 CFNetwork 0x000000018c9bbdf4 +[NSURLConnection(Loader) _resourceLoadLoop:] + 404 (NSURLConnection.mm:364)
6 Foundation 0x000000018cdc7318 __NSThread__start__ + 996 (NSThread.m:1163)
7 libsystem_pthread.dylib 0x000000018b39568c _pthread_body + 240 (pthread.c:697)
8 libsystem_pthread.dylib 0x000000018b39559c _pthread_start + 284 (pthread.c:744)
9 libsystem_pthread.dylib 0x000000018b392cb4 thread_start + 4
Thread 3:
0 libsystem_kernel.dylib 0x000000018b2cce1c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x000000018b394814 _pthread_cond_wait + 640 (pthread_cond.c:536)
2 libc++.1.dylib 0x000000018acbdac8 std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) + 56 (condition_variable.cpp:44)
3 JavaScriptCore 0x0000000190b5bf08 void std::__1::condition_variable_any::wait<std::__1::unique_lock<bmalloc::Mutex> >(std::__1::unique_lock<bmalloc::Mutex>&) + 112 (condition_variable:202)
4 JavaScriptCore 0x0000000190b5be7c bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>::threadRunLoop() + 168 (condition_variable:211)
5 JavaScriptCore 0x0000000190b5bd5c bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>::threadEntryPoint(bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>*) + 36 (AsyncTask.h:110)
6 JavaScriptCore 0x0000000190b5c00c void* std::__1::__thread_proxy<std::__1::tuple<void (*)(bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>*), bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>*> >(void*) + 92 (__functional_base:416)
7 libsystem_pthread.dylib 0x000000018b39568c _pthread_body + 240 (pthread.c:697)
8 libsystem_pthread.dylib 0x000000018b39559c _pthread_start + 284 (pthread.c:744)
9 libsystem_pthread.dylib 0x000000018b392cb4 thread_start + 4
Thread 4 name:
Thread 4:
0 libsystem_kernel.dylib 0x000000018b2af224 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x000000018b2af09c mach_msg + 72 (mach_msg.c:103)
2 CoreFoundation 0x000000018c280e90 __CFRunLoopServiceMachPort + 192 (CFRunLoop.c:2527)
3 CoreFoundation 0x000000018c27eae4 __CFRunLoopRun + 1060 (CFRunLoop.c:2870)
4 CoreFoundation 0x000000018c1aeda4 CFRunLoopRunSpecific + 424 (CFRunLoop.c:3113)
5 WebCore 0x0000000190e79d3c RunWebThread(void*) + 456 (WebCoreThread.mm:694)
6 libsystem_pthread.dylib 0x000000018b39568c _pthread_body + 240 (pthread.c:697)
7 libsystem_pthread.dylib 0x000000018b39559c _pthread_start + 284 (pthread.c:744)
8 libsystem_pthread.dylib 0x000000018b392cb4 thread_start + 4
Thread 5 name:
Thread 5:
0 libsystem_kernel.dylib 0x000000018b2cce1c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x000000018b394814 _pthread_cond_wait + 640 (pthread_cond.c:536)
2 JavaScriptCore 0x00000001901af9a4 WTF::ThreadCondition::timedWait(WTF::Mutex&, double) + 80 (ThreadingPthreads.cpp:359)
3 JavaScriptCore 0x0000000190b42a68 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 2256 (ParkingLot.cpp:597)
4 JavaScriptCore 0x00000001907baf58 JSC::Heap::stopTheMutator() + 272 (ParkingLot.h:81)
5 JavaScriptCore 0x00000001907b89a0 JSC::Heap::stopTheWorld() + 160 (Heap.cpp:1219)
6 JavaScriptCore 0x00000001907ba230 JSC::Heap::collectInThread() + 192 (Heap.cpp:1118)
7 JavaScriptCore 0x00000001907bcd50 JSC::Heap::Thread::work() + 16 (Heap.cpp:229)
8 JavaScriptCore 0x0000000190b327f4 std::__1::__function::__func<WTF::AutomaticThread::start(WTF::Locker<WTF::LockBase> const&)::$_0, std::__1::allocator<WTF::AutomaticThread::start(WTF::Locker<WTF::LockBase> const&)::$_0>, void ()>::operator()() + 352 (AutomaticThread.cpp:215)
9 JavaScriptCore 0x00000001901abf7c WTF::threadEntryPoint(void*) + 212 (functional:1817)
10 JavaScriptCore 0x00000001901abe8c WTF::wtfThreadEntryPoint(void*) + 24 (ThreadingPthreads.cpp:164)
11 libsystem_pthread.dylib 0x000000018b39568c _pthread_body + 240 (pthread.c:697)
12 libsystem_pthread.dylib 0x000000018b39559c _pthread_start + 284 (pthread.c:744)
13 libsystem_pthread.dylib 0x000000018b392cb4 thread_start + 4
Thread 6:
0 libsystem_pthread.dylib 0x000000018b392ca8 start_wqthread + 0 (pthread.c:2333)
Thread 7:
0 libsystem_pthread.dylib 0x000000018b392ca8 start_wqthread + 0 (pthread.c:2333)
Thread 8:
0 libsystem_pthread.dylib 0x000000018b392ca8 start_wqthread + 0 (pthread.c:2333)
Thread 9:
0 libsystem_pthread.dylib 0x000000018b392ca8 start_wqthread + 0 (pthread.c:2333)
Thread 10:
0 libsystem_kernel.dylib 0x000000018b2cda88 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x000000018b3931a4 _pthread_wqthread + 1260 (pthread.c:2205)
2 libsystem_pthread.dylib 0x000000018b392cac start_wqthread + 4
Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x000000000000000c x1: 0x0000000176054d00 x2: 0x0000000000000008 x3: 0x000000018b3132c0
x4: 0x000000016fd72317 x5: 0x0000000000000000 x6: 0x0000000000000001 x7: 0x0000000000000000
x8: 0x000000000000000b x9: 0x0000000000000004 x10: 0x0000000000000000 x11: 0xbaddc0dedeadbead
x12: 0x0000000174c73fb0 x13: 0x0000000000000010 x14: 0x0000000000000008 x15: 0x0000000000000010
x16: 0x00000001010411f0 x17: 0x000000018ad530dc x18: 0x0000000000000000 x19: 0x0000000176054d00
x20: 0x0000000101340560 x21: 0x000000017644f810 x22: 0x0000000000000000 x23: 0x00000001001bb5cc
x24: 0x000000012a61f840 x25: 0x000000017569d150 x26: 0x0000000174243fa8 x27: 0x00000001003f5b30
x28: 0x0000000100d31660 fp: 0x000000016fd726c0 lr: 0x00000001001c8c4c
sp: 0x000000016fd72640 pc: 0x00000001001c8e9c cpsr: 0x20000000
XCode崩溃登录指向此功能
func textViewDidEndEditing(_ textView: UITextView) {
selectButton.isSelected = false
selectButtonAction(true)
delegate?.didUpdateText(self, withText: textView.text) //Crash points to this line
}
由于代表是可选的,我相信它不应该在这条线上崩溃,所以如果我在这里对代表进行零检查,我认为它不会有任何好处。反正是否有可能从这个日志中找出导致崩溃的原因?