我已经通过 testflight 向试点小组发布了我的应用程序(iOS 10+),最近我收到了指向一些 _handleTLSEvent 的崩溃报告。我的应用程序还安装了 crashlytics,崩溃描述为
断言失败:(!_tlsResumeBlock),函数 _handleTLSEvent,文件 /BuildRoot/Library/Caches/com.apple.xbs/Sources/CFNetwork/CFNetwork-889.9/Connection/TCPIOConnection.cpp,第 4628 行。
但我无法确定崩溃的根本原因。下面是崩溃日志
OS Version: iPhone OS 11.1
Baseband Version: n/a
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 9
Thread 0 name:
Thread 0:
0 UIFoundation 0x000000018bd6a4a8 -[NSStringDrawingContext dealloc] + 100 (NSStringDrawing.m:126)
1 UIFoundation 0x000000018bd6a49c -[NSStringDrawingContext dealloc] + 88 (NSStringDrawing.m:125)
2 UIKit 0x000000018ac4fd24 -[UILabel _drawTextInRect:baselineCalculationOnly:] + 3940 (UILabel.m:3034)
3 UIKit 0x000000018acba7a0 -[UILabel drawTextInRect:] + 904 (UILabel.m:2620)
4 UIKit 0x000000018acba3c0 -[UIView(CALayerDelegate) drawLayer:inContext:] + 408 (UIView.m:14812)
5 QuartzCore 0x00000001857efa9c -[CALayer drawInContext:] + 296 (CALayer.mm:8884)
6 QuartzCore 0x00000001856eabf4 CABackingStoreUpdate_ + 232 (CABackingStore.cpp:1149)
7 QuartzCore 0x00000001857f5780 invocation function for block in CA::Layer::display_() + 52 (CALayer.mm:8741)
8 QuartzCore 0x00000001857ef4c8 -[CALayer _display] + 1672 (CALayer.mm:8739)
9 QuartzCore 0x0000000185762b50 CA::Context::commit_transaction(CA::Transaction*) + 520 (CALayer.mm:2371)
10 QuartzCore 0x0000000185788eb4 CA::Transaction::commit() + 540 (CATransactionInternal.mm:425)
11 QuartzCore 0x00000001856dda04 CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 928 (CADisplay.mm:1457)
12 IOKit 0x0000000181a6c1cc IODispatchCalloutFromCFMessage + 392 (IOKitLib.c:1216)
13 CoreFoundation 0x0000000181790010 __CFMachPortPerform + 188 (CFMachPort.c:689)
14 CoreFoundation 0x00000001817aa96c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56 (CFRunLoop.c:1998)
15 CoreFoundation 0x00000001817aa070 __CFRunLoopDoSource1 + 440 (CFRunLoop.c:2135)
16 CoreFoundation 0x00000001817a7b44 __CFRunLoopRun + 2196 (CFRunLoop.c:3150)
17 CoreFoundation 0x00000001816c7fb8 CFRunLoopRunSpecific + 436 (CFRunLoop.c:3245)
18 GraphicsServices 0x000000018355ff84 GSEventRunModal + 100 (GSEvent.c:2245)
19 UIKit 0x000000018ac9c2f4 UIApplicationMain + 208 (UIApplication.m:3949)
20 My App 0x000000010075b514 main + 92 (main.m:14)
21 libdyld.dylib 0x00000001811ea56c start + 4
Thread 1 name:
Thread 1:
0 libsystem_kernel.dylib 0x00000001812f8bc4 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x00000001812f8a3c mach_msg + 72 (mach_msg.c:103)
2 CoreFoundation 0x00000001817a9c74 __CFRunLoopServiceMachPort + 196 (CFRunLoop.c:2613)
3 CoreFoundation 0x00000001817a7840 __CFRunLoopRun + 1424 (CFRunLoop.c:2969)
4 CoreFoundation 0x00000001816c7fb8 CFRunLoopRunSpecific + 436 (CFRunLoop.c:3245)
5 Foundation 0x00000001820f16e4 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304 (NSRunLoop.m:367)
6 Foundation 0x0000000182110afc -[NSRunLoop(NSRunLoop) runUntilDate:] + 96 (NSRunLoop.m:411)
7 UIKit 0x000000018b7fb2f4 -[UIEventFetcher threadMain] + 136 (UIEventFetcher.m:436)
8 Foundation 0x00000001821f2860 __NSThread__start__ + 996 (NSThread.m:1181)
9 libsystem_pthread.dylib 0x000000018142c31c _pthread_body + 308 (pthread.c:740)
10 libsystem_pthread.dylib 0x000000018142c1e8 _pthread_start + 312 (pthread.c:799)
11 libsystem_pthread.dylib 0x000000018142ac28 thread_start + 4
Thread 2 name:
Thread 2:
0 libsystem_kernel.dylib 0x00000001812f8bc4 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x00000001812f8a3c mach_msg + 72 (mach_msg.c:103)
2 My App 0x00000001008abf20 CLSMachExceptionServer + 100
3 libsystem_pthread.dylib 0x000000018142c31c _pthread_body + 308 (pthread.c:740)
4 libsystem_pthread.dylib 0x000000018142c1e8 _pthread_start + 312 (pthread.c:799)
5 libsystem_pthread.dylib 0x000000018142ac28 thread_start + 4
Thread 3 name:
Thread 3:
0 libsystem_kernel.dylib 0x00000001812f8bc4 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x00000001812f8a3c mach_msg + 72 (mach_msg.c:103)
2 CoreFoundation 0x00000001817a9c74 __CFRunLoopServiceMachPort + 196 (CFRunLoop.c:2613)
3 CoreFoundation 0x00000001817a7840 __CFRunLoopRun + 1424 (CFRunLoop.c:2969)
4 CoreFoundation 0x00000001816c7fb8 CFRunLoopRunSpecific + 436 (CFRunLoop.c:3245)
5 CFNetwork 0x0000000181e32264 +[NSURLConnection(Loader) _resourceLoadLoop:] + 404 (NSURLConnection.mm:367)
6 Foundation 0x00000001821f2860 __NSThread__start__ + 996 (NSThread.m:1181)
7 libsystem_pthread.dylib 0x000000018142c31c _pthread_body + 308 (pthread.c:740)
8 libsystem_pthread.dylib 0x000000018142c1e8 _pthread_start + 312 (pthread.c:799)
9 libsystem_pthread.dylib 0x000000018142ac28 thread_start + 4
Thread 4:
0 libsystem_kernel.dylib 0x0000000181319150 __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x000000018142ed30 _pthread_cond_wait$VARIANT$mp + 640 (pthread_cond.c:579)
2 libc++.1.dylib 0x00000001809d2f34 std::__1::condition_variable::__do_timed_wait(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >) + 96 (__threading_support:284)
3 JavaScriptCore 0x0000000188a75dd0 std::__1::cv_status std::__1::condition_variable::wait_until<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >(std::__1::unique_lock<std::__1::mutex>&, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > > const&) + 124 (__mutex_base:0)
4 JavaScriptCore 0x0000000188a75ca4 std::__1::cv_status std::__1::condition_variable_any::wait_until<std::__1::unique_lock<bmalloc::Mutex>, std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > >(std::__1::unique_lock<bmalloc::Mutex>&, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > > const&) + 108 (condition_variable:224)
5 JavaScriptCore 0x0000000188a75b28 bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>::threadRunLoop() + 280 (condition_variable:235)
6 JavaScriptCore 0x0000000188a75e20 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, void (*)(bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>*), bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>*> >(void*) + 44 (type_traits:4291)
7 libsystem_pthread.dylib 0x000000018142c31c _pthread_body + 308 (pthread.c:740)
8 libsystem_pthread.dylib 0x000000018142c1e8 _pthread_start + 312 (pthread.c:799)
9 libsystem_pthread.dylib 0x000000018142ac28 thread_start + 4
Thread 5 name:
Thread 5:
0 libsystem_kernel.dylib 0x0000000181319150 __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x000000018142ed30 _pthread_cond_wait$VARIANT$mp + 640 (pthread_cond.c:579)
2 WebCore 0x0000000189551690 SendDelegateMessage(NSInvocation*) + 588 (WebCoreThread.mm:782)
3 CoreFoundation 0x00000001818073bc ___forwarding___ + 624 (NSForwarding.m:3259)
4 CoreFoundation 0x00000001816ed01c _CF_forwarding_prep_0 + 92
5 WebKitLegacy 0x000000018a959ec4 WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(WebCore::NavigationAction const&, WebCore::ResourceRequest const&, bool, WebCore::FormState*, WTF::Function<void (WebCore::PolicyAction)>&&) + 416 (WebFrameLoaderClient.mm:902)
6 WebCore 0x000000018a22611c WebCore::PolicyChecker::checkNavigationPolicy(WebCore::ResourceRequest const&, bool, WebCore::DocumentLoader*, WebCore::FormState*, WTF::Function<void (WebCore::ResourceRequest const&, WebCore::FormState*, bool)>) + 1380 (PolicyChecker.cpp:150)
7 WebCore 0x0000000189a0a324 WebCore::FrameLoader::loadWithDocumentLoader(WebCore::DocumentLoader*, WebCore::FrameLoadType, WebCore::FormState*, WebCore::AllowNavigationToInvalidURL) + 1252 (FrameLoader.cpp:1502)
8 WebCore 0x0000000189a09d44 WebCore::FrameLoader::load(WebCore::FrameLoadRequest&&) + 580 (FrameLoader.cpp:1379)
9 WebKitLegacy 0x000000018a8b6a94 -[WebFrame loadRequest:] + 320 (WebFrame.mm:2480)
10 WebCore 0x000000018a67423c HandleRunSource(void*) + 688 (WebCoreThreadRun.cpp:98)
11 CoreFoundation 0x00000001817aa2e8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 (CFRunLoop.c:1982)
12 CoreFoundation 0x00000001817aa268 __CFRunLoopDoSource0 + 88 (CFRunLoop.c:2017)
13 CoreFoundation 0x00000001817a9af0 __CFRunLoopDoSources0 + 204 (CFRunLoop.c:2053)
14 CoreFoundation 0x00000001817a76c8 __CFRunLoopRun + 1048 (CFRunLoop.c:2920)
15 CoreFoundation 0x00000001816c7fb8 CFRunLoopRunSpecific + 436 (CFRunLoop.c:3245)
16 WebCore 0x000000018953be04 RunWebThread(void*) + 456 (WebCoreThread.mm:694)
17 libsystem_pthread.dylib 0x000000018142c31c _pthread_body + 308 (pthread.c:740)
18 libsystem_pthread.dylib 0x000000018142c1e8 _pthread_start + 312 (pthread.c:799)
19 libsystem_pthread.dylib 0x000000018142ac28 thread_start + 4
Thread 6:
0 libsystem_pthread.dylib 0x000000018142ac1c start_wqthread + 0
Thread 7:
0 libsystem_pthread.dylib 0x000000018142ac1c start_wqthread + 0
Thread 8:
0 libsystem_pthread.dylib 0x000000018142ac1c start_wqthread + 0
Thread 9 name:
Thread 9 Crashed:
0 libsystem_kernel.dylib 0x0000000181319348 __pthread_kill + 8
1 libsystem_pthread.dylib 0x000000018142d344 pthread_kill$VARIANT$mp + 396 (pthread.c:1484)
2 libsystem_c.dylib 0x000000018128905c __abort + 152 (abort.c:128)
3 libsystem_c.dylib 0x0000000181288fc4 abort + 152 (abort.c:99)
4 libsystem_c.dylib 0x000000018125ca9c __assert_rtn + 316 (assert.c:91)
5 CFNetwork 0x0000000181f138cc TCPIOConnection::_handleTLSEvent(nw_tls_context*, tls_handshake_message_t, void () block_pointer, bool) + 772 (TCPIOConnection.cpp:4628)
6 libnetwork.dylib 0x00000001826ee964 __tcp_connection_set_tls_message_handler_on_nw_connection_block_invoke + 168 (tcp_connection.m:1799)
7 libboringssl.dylib 0x00000001825c6cf4 ___boringssl_context_certificate_request_callback_block_invoke + 160 (boringssl_session.c:2451)
8 libdispatch.dylib 0x0000000181185088 _dispatch_call_block_and_release + 24 (init.c:994)
9 libdispatch.dylib 0x0000000181185048 _dispatch_client_callout + 16 (object.m:502)
10 libdispatch.dylib 0x000000018118ee48 _dispatch_queue_serial_drain$VARIANT$mp + 528 (inline_internal.h:2500)
11 libdispatch.dylib 0x000000018118f7d8 _dispatch_queue_invoke$VARIANT$mp + 340 (queue.c:5302)
12 libdispatch.dylib 0x000000018118ed00 _dispatch_queue_serial_drain$VARIANT$mp + 200 (inline_internal.h:2539)
13 libdispatch.dylib 0x000000018118f7d8 _dispatch_queue_invoke$VARIANT$mp + 340 (queue.c:5302)
14 libdispatch.dylib 0x0000000181190200 _dispatch_root_queue_drain_deferred_wlh$VARIANT$mp + 400 (queue.c:5920)
15 libdispatch.dylib 0x00000001811984a0 _dispatch_workloop_worker_thread$VARIANT$mp + 644 (source.c:2515)
16 libsystem_pthread.dylib 0x000000018142afd0 _pthread_wqthread + 932 (pthread.c:2207)
17 libsystem_pthread.dylib 0x000000018142ac20 start_wqthread + 4
Thread 10:
0 libsystem_kernel.dylib 0x00000001812f8c18 semaphore_timedwait_trap + 8
1 libdispatch.dylib 0x00000001811874d0 _dispatch_sema4_timedwait$VARIANT$mp + 84 (lock.c:149)
2 libdispatch.dylib 0x0000000181187d40 _dispatch_semaphore_wait_slow + 72 (semaphore.c:127)
3 libdispatch.dylib 0x00000001811936ac _dispatch_worker_thread + 256 (queue.c:6179)
4 libsystem_pthread.dylib 0x000000018142c31c _pthread_body + 308 (pthread.c:740)
5 libsystem_pthread.dylib 0x000000018142c1e8 _pthread_start + 312 (pthread.c:799)
6 libsystem_pthread.dylib 0x000000018142ac28 thread_start + 4
Thread 11:
0 libsystem_kernel.dylib 0x00000001812f8c18 semaphore_timedwait_trap + 8
1 libdispatch.dylib 0x00000001811874d0 _dispatch_sema4_timedwait$VARIANT$mp + 84 (lock.c:149)
2 libdispatch.dylib 0x0000000181187d40 _dispatch_semaphore_wait_slow + 72 (semaphore.c:127)
3 libdispatch.dylib 0x00000001811936ac _dispatch_worker_thread + 256 (queue.c:6179)
4 libsystem_pthread.dylib 0x000000018142c31c _pthread_body + 308 (pthread.c:740)
5 libsystem_pthread.dylib 0x000000018142c1e8 _pthread_start + 312 (pthread.c:799)
6 libsystem_pthread.dylib 0x000000018142ac28 thread_start + 4
Thread 9 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x0000000000000001
x4: 0x0000000000000000 x5: 0x0000000000989680 x6: 0x0000000000000000 x7: 0x0000000000000403
x8: 0x000000000c000000 x9: 0x0000000004000000 x10: 0x00000000000003e8 x11: 0x000000000000000a
x12: 0x0000000000000000 x13: 0x0000000000000034 x14: 0x00000010082d1529 x15: 0x0000000000000000
x16: 0x0000000000000148 x17: 0x00000001811b2ebc x18: 0x0000000000000000 x19: 0x0000000000000006
x20: 0x000000016f98f000 x21: 0x0000000000001214 x22: 0x000000000000cabf x23: 0x000000016f98f0e0
x24: 0x00000001b07ee000 x25: 0x0000000000000000 x26: 0x0000000000000000 x27: 0x0000000000000000
x28: 0x00000001c18f7f00 fp: 0x000000016f98e4c0 lr: 0x000000018142d344
sp: 0x000000016f98e490 pc: 0x0000000181319348 cpsr: 0x00000000
根据我的日志,它似乎在某些 TLS 握手连接期间崩溃了,但我有点卡在这里,因为我无法重现此崩溃,当我与我的客户核实时,他们也无法重现它,他们说偶尔发生。如果有人可以通过查看下面的日志来确定这次崩溃的根本原因,或者为我指明下一步如何进行的正确方向,那就太好了。