Open UditHD opened 5 years ago
Hi, @UditHD The latest version 1.3.0-alpha has fixed it
@HJianBo no it doesn't fix it. Few days ago we updated CocoaMQTT to 1.3.0-alpha and it stills crashes almost every-time you get a notification. Here're the logs:
EXC_BAD_ACCESS: Attempted to dereference garbage pointer 0x7ff192083e08.
0 <compiler-generated> subscript.get
1 <compiler-generated> deliver
2 App name partial apply forwarder for closure #1 () -> () in CocoaMQTT.CocoaMQTTDeliver.(sendfun in _95E0A6B76F6AC9616E232A5BF1E96E76)(CocoaMQTT.Frame) -> () (CocoaMQTTDeliver.swift:240:22)
3 <compiler-generated> reabstraction thunk helper from @escaping @callee_guaranteed () -> () to @escaping @callee_unowned @convention(block) () -> ()
4 libdispatch.dylib _dispatch_call_block_and_release
5 libdispatch.dylib _dispatch_client_callout
6 libdispatch.dylib _dispatch_root_queue_drain
7 libdispatch.dylib _dispatch_worker_thread2
8 libsystem_pthread.dylib _pthread_wqthread
9 libsystem_pthread.dylib start_wqthread
@sidlauskaslukas Are you recreating the CocoaMQTT instance every-time? When are you able to see this issue?
@HJianBo Can you please release an official version? The Alpha tag denotes the build is not stable yet.
@sachinvas CocoaMQTT instance is created once in the app's lifetime. The app crashes immediately after receiving the MQTT notification. The problem still persists.
@sidlauskaslukas Are you changing the delegateQueue
after connecting to the MQTT broker? As far as I can understand the DispatchQueue
is being released before the task is getting completed.
Hi @sidlauskaslukas sorry to the late reply here. Can you give me any suggestion to reproduce that on v1.3.0-alpha.1?
@sidlauskaslukas Are you changing the
delegateQueue
after connecting to the MQTT broker? As far as I can understand theDispatchQueue
is being released before the task is getting completed.
No, we're not changing the delegateQueue
. We use the one which is set in the CocoaMQTT
class:
public var delegateQueue = DispatchQueue.main
The problem still persists and it seems that in 10.15.x the app crashes even more often due to this problem
I have the same issue on my app.
Crashed: com.apple.root.default-qos.overcommit 0 CocoaMQTT 0x1019d41e4 CocoaMQTTDeliver.redeliver() + 4319740388 (<compiler-generated>:4319740388) 1 CocoaMQTT 0x1019d4cbc partial apply for closure #2 in CocoaMQTTDeliver.deliver(_:) + 142 (CocoaMQTTDeliver.swift:142) 2 CocoaMQTT 0x1019d5ba0 closure #1 in closure #1 in CocoaMQTTTimer.timer.getter + 53 (CocoaMQTTTimer.swift:53) 3 CocoaMQTT 0x1019c4624 thunk for @escaping @callee_guaranteed () -> () + 4319675940 (<compiler-generated>:4319675940) 4 libdispatch.dylib 0x1e737c7d4 _dispatch_client_callout + 16 5 libdispatch.dylib 0x1e732101c _dispatch_continuation_pop$VARIANT$mp + 412 6 libdispatch.dylib 0x1e7330fa8 _dispatch_source_invoke$VARIANT$mp + 1308 7 libdispatch.dylib 0x1e732d030 _dispatch_root_queue_drain + 372 8 libdispatch.dylib 0x1e732d8d4 _dispatch_worker_thread2 + 128 9 libsystem_pthread.dylib 0x1e755d1b4 _pthread_wqthread + 464 10 libsystem_pthread.dylib 0x1e755fcd4 start_wqthread + 4
Hi, we are getting so many crash due to below reason can you please look into this:-
Swift access race in CocoaMQTT.CocoaMQTTDeliver.(mqueue in _95E0A6B76F6AC9616E232A5BF1E96E76).modify : Swift.Array at 0x7b1400088f40