TrueTime.swift icon indicating copy to clipboard operation
TrueTime.swift copied to clipboard

NTPClient crash

Open kjoneandrei opened this issue 6 years ago • 0 comments

I have encountered a crash in NTPClient caused by non-main threads that appear to use UIKit classes or functions. Generally speaking, it is only safe to use UIKit from the main thread. Calling into UIKit from background threads can cause unpredictable behavior (like crashes!).. Please double check that all of your code (that is not on the main thread) has been explicitly marked as safe to use in the background by Apple.

Encountered on: iOS 12.3.1 TrueTime.swift version "5.0.3"

Stacktrace

Crashed: com.instacart.ntp.client
0  libdispatch.dylib              0x2274326ac _dispatch_sync_f + 4
1  TrueTime                       0x102f09d24 NTPClient.stopQueue() (NTPClient.swift)
2  TrueTime                       0x102f0ac60 NTPClient.finish(_:) + 257 (NTPClient.swift:257)
3  TrueTime                       0x102f0bfe8 closure #1 in NTPClient.query(addresses:host:) + 224 (NTPClient.swift:224)
4  TrueTime                       0x102f03f94 partial apply for closure #2 in static NTPConnection.query(addresses:config:logger:callbackQueue:progress:) + 36 (NTPConnection.swift:36)
5  TrueTime                       0x102f04530 partial apply for closure #1 in NTPConnection.complete(_:) + 201 (NTPConnection.swift:201)
6  TrueTime                       0x102f088b4 thunk for @escaping @callee_guaranteed () -> () (<compiler-generated>)
7  libdispatch.dylib              0x22742c304 _dispatch_call_block_and_release + 32
8  ???                            0x4f74022742d884 (Missing)
9  ???                            0x704b8227434dd4 (Missing)
10 ???                            0x4f060227435918 (Missing)
11 ???                            0x21f1022743dcc0 (Missing)
12 ???                            0x74c00227628a98 (Missing)
13 ???                            0x3612822762edc4 (Missing)

kjoneandrei avatar Jul 30 '19 11:07 kjoneandrei