Skip to content
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-11643] Xcode 11.2 beta 2 Regression: runtime crash with generic Foundation Encoder #54053

Open
groue opened this issue Oct 20, 2019 · 3 comments

Comments

@groue
Copy link

@groue groue commented Oct 20, 2019

Previous ID SR-11643
Radar rdar://problem/56443094
Original Reporter @groue
Type Bug

Attachment: Download

Environment

Xcode Version 11.2 beta 2 (11B44)

MacOS 10.14.6 (18G87)

Additional Detail from JIRA
Votes 2
Component/s Compiler
Labels Bug, 5.1Regression, RunTimeCrash
Assignee None
Priority Medium

md5: b518bac98f64f18f48b7a0e0d3852343

Issue Description:

Hello,

When an Encoder is generic and defined in a Swift Package library module, an Xcode app can't import this module and use this encoder without crashing right between the instantiation of the encoder and the call to the container(keyedBy: ) method, which is never called.

A reproducible case is available at http://github.com/groue/GRDBIssue636, and attached to this issue.

To reproduce:

  1. Open the Crash/Crash.xcodeproject project with Xcode 11.2 beta 2

  2. Run the app in an iOS simulator

  3. Expected: the app crashes with a "not implemented" fatal error

  4. Actual: the app crashes before the "not implemented" fatal error

Experiments reveal that the bug does not reproduce when the encoder is not generic.

Experiments reveal that the bug does not reproduce when the encoder is invoked from another swift package (run `swift build` and then `.build/debug/Crash` in order to see the expected "not implemented" fatal error, and not the unexpected crash.

This issue was first reported in groue/GRDB.swift#636

@groue
Copy link
Author

@groue groue commented Oct 20, 2019

Cross-posted on Apple Feedback Assistant, since this may be an Xcode issue: FB7395337

@swift-ci
Copy link
Collaborator

@swift-ci swift-ci commented Nov 1, 2019

Comment by Randy R (JIRA)

We found a workaround. Setting DEAD_CODE_STRIPPING = NO in our app’s target fixes the crash.

@swift-ci
Copy link
Collaborator

@swift-ci swift-ci commented Dec 6, 2019

Comment by Caleb J (JIRA)

+1.

I'm also seeing this problem in Version 11.2.1 (11B500) Latest Mac AppStore Release. Setting `DEAD_CODE_STRIPPING=NO` also worked for me.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants