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
[SR-10445] EXC_BAD_INSTRUCTION when accessing property compiled with Xcode 10.2 #4575
Comments
Comment by Vineet Shah (JIRA) @belkadan any updates on this? Note that it's not an LLDB crash as it's currently categorized as. It seems to be a compiler issue that results in crashes at runtime on iOS. Given the severity of the crash and guaranteed reproducibility, this is preventing us from updating to Xcode 10.2, meanwhile all of our development phones have started auto-upgrading to iOS 12.2 so we're running out of devices to test on. Thanks! |
I'm sorry, I can't really say anything here. |
Comment by Aditya Ayyakad (JIRA) @belkadan it looks like the type of the array is getting erased? ``` (lldb) po Mirror(reflecting: orderStatuses).children ``` This is preventing me from using Xcode 10.2 or Swift 5 at all with my apps. Please let me know if there's any other information I can provide for you so we can get this resolved as soon as possible. |
I'm sorry, I don't see how that comment is relevant. This sounds a little like something Arnold fixed recently, so you could check a development snapshot from https://swift.org/download and see if the problem reproduces. |
Comment by Aditya Ayyakad (JIRA) @belkadan Sorry but no the latest snapshot does not seem to work still. I tried it both from Xcode and the command line directly, but both crashed in the same way. |
Thanks, that's important to know. |
The initialization of the metadata of single case enums in Swift's runtime is broken. We miss initializing the extraInhabitants field. You can introduce an extra empty case or not use a single case enum as a workaround. |
Will be fixed by apple/swift#24278 and apple/swift#24293 |
Follow-up on our conversation from yesterday: Unfortunately there is no other workaround than to change the enum in the source code. |
Comment by Vineet Shah (JIRA) Can you confirm that changing the enum to `indirect` is a sufficient workaround? |
Yes. Making the enum indirect fixes the crash. |
Attachment: Download
Environment
Xcode Version 10.2 (10E125)
macOS Version 10.14.4
iPhone X Simulator
Additional Detail from JIRA
md5: 7b8d81d9943a8c1c1a7fd78f28934260
is duplicated by:
Issue Description:
I am getting a consistent crash in my app target and tests when accessing a property under very specific conditions (see unit test in attached sample project). The issue is not present in Xcode 10.1.
When printing out the relevant variable on the line of the crash in lldb (`po orderStatuses`), I see:
Each of the 3 changes below seems to stop the crash from happening:
Remove `creationDate` from the `Widget` struct
Remove the `WidgetOrder` wrapper enum and instead use `Widget` directly in its place
Convert the `shipped` property in `WidgetOrderStatus` to an Int (default value 0)
The text was updated successfully, but these errors were encountered: