-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
withCheckedContinuation crashes on Xcode 16 RC #75952
Comments
Quick update:
|
Same issue for me. I'm on Xcode 16.1 beta. App crashes like @MarkVillacampa described with only iOS 18 simulators. Thread 1: EXC_BAD_ACCESS (code=1, address=0x4) |
The crash is still present in Xcode 16 RC when running a Debug build as "Designed for iPad/iPhone" on macOS Sonoma |
Has anyone posted a question on the Apple Developer Forum, and is there a final solution to the problem? |
+1. Any update on this? |
@kiran-nayak-cheq |
We're seeing this for our publicly released apps using Xcode version 16.0 (16A242d) (published, final updates to App Store, not debug versions) where random users are seeing persistent crashes at launch and the stack traces are vague. We see the following in each of them though:
We are personally unable to reproduce this in any environment (debug / release) or on any OS. The users experiencing this range from being on macOS 11 to macOS 15, and iOS 16 / 18. It could potentially be affecting all operating system versions but we are unable to say this with certainty. We are using Xcode 16 to compile our apps using Swift v5 (5.10, not 6). The last update posted from Xcode 15 does not exhibit this issue. |
We're seeing something similar in Alamofire, but in |
We saw similar things on our app but we were able to identify it only happening on iOS 18/macOS 15 betas that were before the RC builds for each platform. We've found 3 cases of users where this was fixed by updating to the actual RC builds for each platform. We did not see this happening before iOS 18/macOS 15. On iOS the crashes looked like SIGSEV 4 with the following line as the top stack. On macOS they looked like the signal in this report (maybe because it's on the simulator it matches the macOS crash signature) ‘‘‘ I was not able to find this generated file anywhere. |
This is a known issue documented in the Xcode 16 release notes (search for 134793410). It was addressed on the |
I'm facing the same Thread 1: I'm using Swift 5 with Xcode 16. Below is a sample code to demonstrate the issue: import Alamofire
import Foundation
struct MyModel: Decodable {
let id: Int
let name: String
}
func fetchData() async -> Result<MyModel, Error> {
return await AF.request("https://api.example.com/data")
.response(MyModel.self)
}
extension DataRequest {
@MainActor
func response<T: Decodable>(_ t: T.Type) async -> Result<T, Error> {
return await withCheckedContinuation { continuation in // Fails on here `EXC_BAD_ACCESS error`
responseData(queue: .main) { response in
switch response.result {
case .success(let data):
do {
let decoder = JSONDecoder()
let obj = try decoder.decode(t.self, from: data)
continuation.resume(returning: .success(obj))
} catch {
continuation.resume(returning: .failure(error))
}
case .failure(let error):
continuation.resume(returning: .failure(error))
}
}
}
}
} The crash occurs when navigating between screens while the API call is still in progress, which leads to an |
Check with these users, they are most likely on an older beta version of iOS 18. I can confirm all our users were on an older beta version and updating to the latest iOS version fixed these crashes for them. |
This was addressed in Swift 6.0.1. |
There is a similar issue that affects older iOS 18 betas. Those devices should really be updated to the iOS 18 release (or newer), but if you need an app-side workaround, see https://forums.swift.org/t/global-with-concurrency-functions-crash-on-catalyst-designed-for-ipad-on-macos/74823/13. |
No, this is a common source of confusion but the setting you have screenshot is the Swift "language mode". The language mode is independent of the version of the Swift compiler you are building with. Swift 6.0.1 refers to the version of the compiler. |
@tshortli thanks for the reply |
hello. I am still experiencing the same issue. Is anyone else having the same problem as me? EnvironmentXcode-16.1(16B40) I have not been able to reproduce the crash in apps built on my local Mac, but it seems to happen in apps uploaded to the app store. |
I have just updated to: This is specifically when building for development. For what its worth a coworker building the same application with these same versions does not cause the same crash. Edit, This is for Rosetta Simulators. |
Hello, I've been struggling with the same problem recently. The problem only occurs in apps distributed through the App Store. Issue iOS version is 18.0.0 Environmentxcode 16.1(16B40) |
@HoonHaChoi you should ask the users of your app to upgrade their iOS version to the latest. They're most likely (read: for sure) on one of the earlier beta versions with the issue. This is no longer an issue with 18 RC or above. |
Description
I can reproduce on Xcode 16 RC and Xcode 16.1 beta, but ONLY when running the app as "Designed for iPhone/iPad" on macOS Sonoma, and ONLY in debug mode (crash goes away in release mode).
I cannot reproduce by running on iOS 17 or 18 neither device nor simulator, and cannot reproduce either when running on macOS Sequoia beta.
Some developers have reported the issue also reproduces when installing the app via TestFlight on an iOS 18 device.
Original issue: RevenueCat/purchases-ios#4177
FB14855530
Reproduction
Stack dump
Expected behavior
It doesnt crash
Environment
Xcode 16.1 beta 1
Apple Swift version 6.0 (swiftlang-6.0.0.7.6 clang-1600.0.24.1)
Target: arm64-apple-macosx14.0
Additional information
No response
The text was updated successfully, but these errors were encountered: