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-11701] Application crashes if protocol name is too long #54109
Comments
Comment by Pavel Sharanda (JIRA) Setting DEAD_CODE_STRIPPING = NO also fixes crash |
What a weird bug! I was able to reproduce it in Xcode 11.2. Steps:
Results: Abort in swift_runtime_unreachable() during swift_getAssociatedConformanceWitnessSlow(). Conditions necessary to reproduce the bug:
However, I couldn't reproduce it with the 11/1 master toolchain, even with the OS standard library. I haven't figured out why yet. |
Can you try with a development toolchain? Might already be fixed on master. This is indeed a weird bug! |
If disabling dead code stripping worked around the bug, then the underlying problem is likely to be either the linker bug behind SR-11564, or a bug in the compiler or linker causing metadata to be stripped that shouldn't be dead. In master, accidental dead stripping is much less likely to occur now that runtime mangled names always use embedded pointers to protocol and type descriptors, which should always be an obvious "use" of the symbol from the linker's perspective. It's possible the bug still lurks but is much less likely to be exercised because of that. |
Comment by Matthaus Woolard (JIRA) I can confirm i am also getting this error (Version 11.2.1 (11B53)) (or something very similar) (feedback report: FB7432118) (see the above `ExampleCrash.zip` application, build this with release mode and it will crash on Ipad Pro) (but interestingly not on iPhone 6s or iPhone SE) settings `DEAD_CODE_STRIPPING = NO` results in this build not crashing. |
Attachment: Download
Additional Detail from JIRA
md5: f2ba56d74bdb38e55a984c6909a09f22
Issue Description:
If we have a swift package (named Test for example) with code:
And make a call from main project like this:
Then we have a crash
If change protocol name from SomeLongProtocol to SomeProtocol there is no crash. Also that protocol is not even used in main project.
Reproducible only in Xcode 11.2, only in Release mode
The text was updated successfully, but these errors were encountered: