-
Notifications
You must be signed in to change notification settings - Fork 656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version 2.60.0 causing app to crash when launched on iOS 15.5 simulator #2574
Comments
Could you provide us with a crash report? Here is some information how to gather crash reports. |
Here is a crash report from one of the sessions APP_NAME-2023-10-25-133231.txt |
hm... this doesn't include a backtrace/stacktrace. Do you have this as well? The crashing thread is the most important thing but from the other running threads would be good as well. Preferably symbolicated. |
@dnadoba this has a stack trace
but it seems to be crashing in dyld. @MatthewTHFisher this seems unrelated to SwiftNIO, it's crashing in dyld before your binary could be loaded. Can you try again? Maybe with a clean build? |
After performing a clean build the issue still persists. I also get this output in Xcode
|
And if you downgrade to NIO 2.59.0 it disappears? |
Just tried again, downgraded to NIO 2.59.0 and performed a clean build, the app runs as expected |
@weissi do you recall if dyld in the simulator logs to the host unified log? |
I would very much assume so but I don't know for a fact |
Just an update, I cloned the NIO package and ran the tests against an iOS 15.5 simulator (setting the packages minimum platform to iOS 15) and it crashed on me there too. The test file is let upgraders: [any NIOTypedHTTPClientProtocolUpgrader<Bool>] = Array(clientUpgraders.map { $0 as! any NIOTypedHTTPClientProtocolUpgrader<Bool> }) I have a slight suspicion that this is related to the casting of a generic type. Maybe linked to this issue swiftlang/swift#64657 |
@MatthewTHFisher Does Either way, given the dyld issue I think you'll want to use Feedback Assistant to file an issue with an attached sysdiagnose. If you do this, please provide a feedback number on this issue so we can correlate. |
Tried to look in the I have however managed to replicate this issue on a new project within Xcode and have written the steps to reproduce this result.
At this point when the app launches and crashes I get the same error message in Xcode as experienced earlier (just with different project names):
I have also attached the crash report here > Swift-NIO-2-60-0-Check-2023-10-26-094542.txt To get around this issue on the above new project, try running the project with swift-nio set to |
Can you try using Xcode 15 and see if you can still reproduce this? This looks like a compiler bug where we emitted |
Just had a colleague test this on their MacBook (M1 chip, Xcode 15.0.0) and the result was the same. The app crashed on launch with the following output.
|
Thanks for all the investigation. At this point, can you please file a feedback using Apple feedback tool, attach all of the information you provided here and please send us the feedback number. |
Feedback has been submitted titled "swift-nio version 2.60.0 is causing apps to crash when launched on iOS 15 simulators" and has a feedback number of Edit: |
I just hit this, and my crash was on device. Rolling back to 2.59.0 fixed the issue for me as well. |
Same problem on macOS 12.3
|
Thanks git bisect: "de07e573d6fbce99cc72a558ce61dbb1ccddb205 is the first bad commit" |
# Motivation We got reports in apple#2574 that our new typed HTTP upgrader are hitting a Swift compiler bug which manifests in a runtime crash on older iOS/macOS/etc. # Modification This PR backs out the new typed HTTP protocol upgrader APIs so that we can unblock our users until the Swift compiler bug is fixed. # Result No more crashes for our users.
Thanks for all the reports. I opened a PR #2579 that backs out the new APIs that are the culprit for this crash for now. I would appreciate if @MatthewTHFisher you could re-run your test but point at my PR branch. |
Just tested using two methods against your branch @FranzBusch:
|
# Motivation We got reports in #2574 that our new typed HTTP upgrader are hitting a Swift compiler bug which manifests in a runtime crash on older iOS/macOS/etc. # Modification This PR backs out the new typed HTTP protocol upgrader APIs so that we can unblock our users until the Swift compiler bug is fixed. # Result No more crashes for our users.
We just released a new version that backs out the new API: https://github.com/apple/swift-nio/releases/tag/2.61.0. Please confirm that this fixes the crash |
Confirmed that 2.61.0 does not cause a crash on my iOS 15 device. |
This is recently fixed upstream by swiftlang/swift#69475 on Swift 5.10. |
With this issue closed, should is the NIOWebSocketServer unblocked (see https://github.com/apple/swift-nio/blob/main/Sources/NIOWebSocketServer/Server.swift#L51) or is there additional work that need to be done to enable the WebSocketServer example code again? |
We have to wait for a new compiler/Xcode release that includes this fix and then we can ship it again. We don't want to add the APIs only for Linux right now but also for Darwin. Once the releases have shipped we will add them back with the appropriate compiler guards around them. For the time being you can probably just copy what we have backed out and it will work as long as you don't deploy to older iOS/macOS/etc. versions. |
Expected behavior
When running our iOS app on an iOS 15.5 simulator with the swift-nio package version
2.60.0
, our app launches and runs as expected.Actual behavior
When running on a iOS 15.5 simulator while using swift-nio 2.60.0, the app launches and then immediately crashes with
Thread 1: signal SIGABRT
When run on a iOS 16.4 simulator the app runs as expected.
Workaround
Downgrade to swift-nio version
2.59.0
and the app runs fine on iOS 15.5 simulators.System & version information
OS System - MacOS 13.6 (22G120)
Processer type - Attempted on both Intel and Apple-silicon
Xcode - 14.3.1 (14E300c)
Xcode simulators - iPhone 12 | iOS 15.5 & iOS 16.4
The text was updated successfully, but these errors were encountered: