CocoaMQTT
CocoaMQTT copied to clipboard
Crash when build by Xcode 14.0 beta 5 (14A5294e) and run on iOS 16.0 (20A5339d)
We have a very similar problem with our project.
Hi, bro @markusgrape . Do you have a way to reproduce this issue?
@leeway1208 In my project it happens during establishing connection with a MQTT broker.
@leeway1208 the crash seems to come directly after we connect to MQTT broker when using xcode 14.0 beta 5. The stacktrace looks very similar to the image above.
CocoaMQTT(info): Connected to x.x.x.x : 8083 CocoaMQTT(info): Enable backgrounding socket successfully (lldb) <- Crash
@markusgrape Will the demo report crash either? I can't reproduce it yet, hope you can help me. Thanks~~
Same crash here. Running iPad OS beta 5 and Xcode beta 3.
iPadOS beta 3 is fine though.
@leeway1208 are you using Xcode beta 5/iOS 16 device? it is 100% reproducible for me when using that, every time it connects to MQTT broker there is this crash.
Needs to be an issue with iOS 16. Using Xcode beta 5 with iPadOS 15 works fine.
@jojo0899 Not sure about this, we tested building with xcode 13 and iOS16 device without issues.
I find simulator can not reproduce so far. It seems to be caused by the real IOS devices.
We have the same issue. It works fine on iOS 16 simulators, but not on a real iOS device. Using Xcode 14 beta 5 and iOS 16.0 public beta (20A5349b).
When using Xcode 14 beta 5 with iOS 15 on a real device, it works fine though.
I'm experiencing the exact same crash, and I tested with different configurations using the example project in this repo. It only happens with Xcode 14 beta 5 and iOS 16.0 public beta (20A5349b) on a real device. I haven't seen the crash for the following configurations.
- Xcode 14 beta 5 and iOS 16 simulator
- Xcode 14 beta 5 and iOS 15.5 device
- Xcode 14 beta 5 and MacBook with M1 pro chip
- Xcode 13.4.1 and iOS 16.0 public beta device
- Xcode 13.4.1 and iOS 15.5 simulator
- Xcode 13.4.1 and iOS 15.6 device
- Xcode 13.4.1 and MacBook with M1 pro chip
@ridvankotan thanks for your support
@leeway1208 any update on this?
Hi. We are working on it. Will get back to you soon.
I wonder has the the recently released beta 7 had any impact on this ? And now beta 8?
I tested with the latest iOS 16 beta 7 and Xcode beta, and we still have the same crash.
Any update on this? Thanks in advance.
I just tested this patch https://github.com/robbiehanson/CocoaAsyncSocket/pull/802/files manually on CocoaAsyncSocket and it solved this crash for me, hopefully there is an official release soon.
I can confirm that the above mentioned patch works.
waiting for the fix, the crash is reproducible on Xcode 14, stable release for CocoaMQTT 2.0.5
I also confirm that mentioned patch of CocoaAsyncSocket
solves the issue. As the CocoaAsyncSocket
project seems to be dead, are there any plans on dropping this dependency? As now CocoaMQTT
is basically unusable on iOS 16 solely due to this issue.
Same issue:
- Xcode 14
- iOS 16
- CocoaMQTT 2.0.5
The crash happens here (line 3052 GCDAsyncSocket didConnect):
[theDelegate socket:self didConnectToHost:host port:port];
I just tested this patch https://github.com/robbiehanson/CocoaAsyncSocket/pull/802/files manually on CocoaAsyncSocket and it solved this crash for me, hopefully there is an official release soon.
I can confirm the crash is solved changing kCFStreamNetworkServiceType
from kCFStreamNetworkServiceTypeVoIP
to kCFStreamNetworkServiceTypeBackground
Crash happen because CocoaAsyncSocket 7.6.5 still use kCFStreamNetworkServiceTypeVoIP. To See This CocoaAsyncSocket doesn't update, you can fix it by change code yourself.
Add #import to GCDAsyncSocket.m #import <PushKit/PushKit.h>
Replace in enableBackgroundingOnSocketWithCaveat r1 = CFReadStreamSetProperty(readStream, kCFStreamNetworkServiceType, PKPushTypeVoIP); r2 = CFWriteStreamSetProperty(writeStream, kCFStreamNetworkServiceType, PKPushTypeVoIP);
Also, you disable backgroundOnSocket to false, but it's not well.
@seasonZhu Run OK, thank you, the backgroundOnSocket is normal
@seasonZhu Run OK, thank you, the backgroundOnSocket is normal
Same here...
Any update on when there will be an official fix?
Any update on when there will be an official fix?
I tried to fix it yesterday. You can update the latest version.