We've noticed a pretty common crash that's occurring in our app that appears to only be affecting iOS 18 users. The code in question is below:
func getThing() async throws -> ThingData {
guard shouldRefresh, let data = self.thingData else {
let remoteThingData = try await store.getThingData()
self.thingData = remoteThingData
return remoteThingData // Crash happens here
}
return data
}
The crash happens on a background thread and the actual crash is:
Crashed: com.apple.root.user-initiated-qos.cooperative
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x00000004a67149c0
We haven't been able to reproduce the error ourselves but in the past 90 days all of the crashes (several thousand) have been only on iOS 18.
We also found this thread that appears similar from 2 years ago but unsure if it's related because in our case the guard can only be calculated at runtime so there shouldn't be any optimizations happening.
Selecting any option will automatically load the page