-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Regression: Concurrent read from __SwiftDeferredNSArray crashing in Swift 5.7 #60418
Comments
|
Experiencing same crash! Thanks for reporting. Note this affects all Swift arrays accessed in ObjC. Would think that is common. |
|
I just want to point that for the provided example, the array size required to produce the crash varies by device. For my iPad is around 10,000 and for iOS simulator is about 10,000,000. In the real world, this our our top crash for users on an iOS 16 device. |
|
This example involves types that are not bridged verbatim ( |
|
If this issue is unrelated to the suggested commit, just wondering if this is being investigated to determine the cause. |
|
Did anyone figure out something about this? Found this issue on our App in the wild. I am a bit concerned that there will not be a fix before iOS 16 is released and our App is crashing massively. How did you go about this? Is there information somewhere other than this issue? Did any of you file a radar/feedback? Did you implement a workaround instead of waiting? I am curious 😊 |
We were able to get a quick-and-dirty workaround by doing an initial read from the array on a single thread. We didn't file on the Feedback Assistant but made a Swift Forums post here. |
|
Thanks for the update @matttodd. I guess we'll go for a workaround as well. |
|
Me too. I encounter with this some sort of bug about SwiftArray too. But in my situation, I just use try? JSONSerialization.data(withJSONObject: containerModel, options: .fragmentsAllowed) It's crash inside this JSONSerialization.data method even I use optional try. Attached is stack trace. |

Describe the bug
In my app, we experienced a new
EXC_BAD_ACCESScrash from users on iOS 16 (beta 4 - build 20A5328h) when reading from a swift Array bridged to NSArray on multiple threads. The crash can be reproduced by running the function provided below.Steps To Reproduce
Expected behavior
Reading from an NSArray should be thread safe.
Environment (please fill out the following information)
Additional context
My theory is it has to do with recent changes to
_swift_setClassMetadatain this commitThe text was updated successfully, but these errors were encountered: