SwiftyPing icon indicating copy to clipboard operation
SwiftyPing copied to clipboard

Bringing app to foreground crash

Open paulotaylor opened this issue 3 years ago • 5 comments

I'm wondering if you had this issue before, maybe I'm doing something wrong. It crashes when bringing up the app to foreground after being in the background for a while and setting handleBackgroundTransitions = true

Crashed: com.apple.main-thread EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000121bec008 Crashed: com.apple.main-thread 0 libswiftCore.dylib 0x192f1162c swift_release + 44 1 libswiftCore.dylib 0x192bac8a8 Array.makeUniqueAndReserveCapacityIfNotUnique() + 212 2 libswiftCore.dylib 0x192bacac8 Array.append(:) + 40 3 MyApp 0x100cd8984 SwiftyPing.informObserver(of:) + 435 (SwiftyPing.swift:435) 4 MyApp 0x100cdaa1c SwiftyPing.socket(socket:didReadData:) + 571 (SwiftyPing.swift:571) 5 MyApp 0x100cd6558 closure #1 in closure #1 in SwiftyPing.createSocket() + 281 (SwiftyPing.swift:281) 6 MyApp 0x100cd660c @objc closure #1 in closure #1 in SwiftyPing.createSocket() + 84 (:84) 7 CoreFoundation 0x18efb78dc __CFSocketPerformV0 + 812 8 CoreFoundation 0x18efac9e8 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 28 9 CoreFoundation 0x18efac8e4 __CFRunLoopDoSource0 + 208 10 CoreFoundation 0x18efabbe8 __CFRunLoopDoSources0 + 268 11 CoreFoundation 0x18efa5bc8 __CFRunLoopRun + 820 12 CoreFoundation 0x18efa5360 CFRunLoopRunSpecific + 600 13 GraphicsServices 0x1a65e3734 GSEventRunModal + 164 14 UIKitCore 0x191a20584 -[UIApplication _run] + 1072 15 UIKitCore 0x191a25df4 UIApplicationMain + 168 16 MyApp 0x100c7b7ec main + 34 (AppDelegate.swift:34) 17 libdyld.dylib 0x18ec61cf8 start + 4

paulotaylor avatar Jun 24 '21 16:06 paulotaylor

I have the same problem but not in main-thread. It occurs above iOS 15.0, last func Stack maybe in private func informObserver(of response: PingResponse) {

Thread 13 Crashed: 0 libsystem_platform.dylib 0x00000001f0d5cab0 platform_memmove 1 MyApp 0x00000001055708c8 $sSa16_createNewBuffer14bufferIsUnique15minimumCapacity13growForAppendySb_SiSbtF5YDASR12PingResponseV_Tg5 + [ : 0] 2 MyApp 0x0000000105568db8 $s5YDASR10SwiftyPingC14informObserver33_5A2F9010047290E81DA28B78E947473ALL2ofyAA0C8ResponseV_tF + [ : 0] 3 MyApp 0x00000001055685a8 $s5YDASR10SwiftyPingC04sendC033_5A2F9010047290E81DA28B78E947473ALLyyFyycfU 4 MyApp 0x0000000104e0e524 $sIeg_IeyB_TR + [ : 0] 5 libdispatch.dylib 0x0000000180598c04 _dispatch_call_block_and_release 6 libdispatch.dylib 0x000000018059a950 _dispatch_client_callout 7 libdispatch.dylib 0x00000001805a20ac _dispatch_lane_serial_drain 8 libdispatch.dylib 0x00000001805a2c10 _dispatch_lane_invoke 9 libdispatch.dylib 0x00000001805ad318 _dispatch_workloop_worker_thread 10 libsystem_pthread.dylib 0x00000001f0d651b0 _pthread_wqthread

mumuWorld avatar Oct 27 '21 04:10 mumuWorld

I'm having the same issue as well

RobbieElias avatar Feb 03 '22 16:02 RobbieElias

Also having this issue, anybody solve this?

iosdec avatar May 17 '22 15:05 iosdec

I had a crash when coming to foreground, possibly to do with resolving an address.

public static func getIPv4AddressFromHost(host: String) throws -> Data { var streamError = CFStreamError() let cfhost = CFHostCreateWithName(nil, host as CFString).takeRetainedValue() let status = CFHostStartInfoResolution(cfhost, .addresses, &streamError)

I'll change the hostname to an IP and report back.

jamestapping avatar Jun 28 '22 13:06 jamestapping