-
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
[SR-11564] Swift 5.1.1 Regression: Bad access on generic types exported symbols – device only. #53969
Comments
Double-checking: that "iOS 10.2" should be "13.2" as in the Environment field, right? @swift-ci create |
Yes, iOS 13.2b1! My third edit to correct version numbers. I think they're all finally correct now... 🙂 |
Can you try with Xcode 11.1 (11A1027)? |
Hi Erik – it doesn't happen with Xcode 11.1 (11A1027). But it does with Xcode 11.2 beta (11B41). |
Thanks for trying! |
So is the Xcode 11.2 beta using a version of Swift which doesn't contain fixes from Xcode 11.1? |
Ah, sorry. I misread the version number. Disregard my last comment |
Updated to reflect that issue is still outstanding on iOS 13.2 beta 2 and Xcode 11.2 beta 2. |
Comment by Randy R (JIRA) Still happening with Xcode 11.2 final. |
For me also, @jckarter mentioned it may be a linker bug, and to try whole module optimisation, but I don't think that's solved it for me! |
Comment by Ilya Mikhaltsou (JIRA) Is there any estimate for the resolution of this problem? This is blocking us from updating to latest Xcode version |
In the context of the example above, it turns out that using the 'Release' configuration (Edit scheme... > Test > Build Configuration: Release) will prevent a runtime crash – at least in this contrived example. However, that prevents a module from being tested via the "@testable" attribute, and when enabling 'release' configuration in the 'run' mode on my current project where I initially identified the issue, it unfortunately seemed only to move the runtime crash elsewhere. Now I crash with: {code: none} |
Comment by Ilya Mikhaltsou (JIRA) Just got an interesting case. When an app built with Xcode 11.1 (with bitcode enabled) goes to TestFlight — it starts to get the same problem |
Comment by Eric (JIRA) This has completely broken our project. Debug mode will runtime crash on import, and Release mode will runtime crash when an imported 3rd party library's items are accessed. In our case RxSwift via SPM. I've tested Debug (debug executible), Release (debug executable), and Release (non-debug executale) to no avail. Any suggested workarounds? Xcode 11.2 final, Catalina 10.15.1, iOS 13.2 |
Comment by Randy R (JIRA) We found a workaround. Setting DEAD_CODE_STRIPPING = NO in our app’s target fixes the crash. |
Comment by Daniel Lindenkreuz (JIRA)
This workaround works for me as well. |
Comment by Brandon Withrow (JIRA) We are also experiencing this issue in the Lottie framework (airbnb/lottie-ios#1066 When the library is imported as a SPM package the build crashes, however if the package is imported with carthage, cocoapods, or even manually the issue is not present. Setting DEAD_CODE_STRIPPING = NO fixes the issue with SPM. It seems that the generic generated classes are stripped when imported with SPM. |
Comment by Srđan Rašić (JIRA) ReactiveKit has been hit by this issue as well (DeclarativeHub/ReactiveKit#233). We are experiencing projects crashing when calling various methods with EXC_BAD_ACCESS. Last call on the stack trace prints error: memory read failed for 0x1618de600). Setting DEAD_CODE_STRIPPING = NO seems to fix the issue. Xcode 11.2 on Mojave 10.14.6. |
Comment by Randy R (JIRA) This is interesting: https://github.com/DeclarativeHub/ReactiveKit/pull/234/files The declaration order of methods might affect whether the symbols are stripped, e.g. public symbols before private symbols. |
Same issue here, also solved with the DEAD_CODE_STRIPPING = NO workaround : groue/GRDB.swift#640 Likely duplicate bug: https://bugs.swift.org/browse/SR-11643 |
Comment by Willie (JIRA) I can also confirm that the annoying work around DEAD_CODE_STRIPPING = NO did fix this terrible problem. I hope it will be fixed soon. |
Comment by Jorge Revuelta Herrero (JIRA) Happening with RxSwift as well, the workaround fixes it, the Xcode 11.2.1 GM does not fix the issue. |
Seen in grpc-swift + swift-nio too apple/swift-nio#1227 (comment) |
Comment by Rolandas Razma (JIRA) I believe we seeing same bug on Xcode 11.0 just it manifest bit later. We moved RxSwift from CocoaPods to SPM and:
DEAD_CODE_STRIPPING = NO - fixes crash on all versions |
Comment by Ilya Mikhaltsou (JIRA) RolandasR (JIRA User), crash after submission seems to be caused by Apple’s internal tooling. This started happening to us only after the day Xcode 11.2 was released and also turning bitcode off for the app to be submitted fixed issue for older Xcode. |
Comment by Kyle Browning (JIRA) Came across this issue yesterday. Using Xcode 11.2.1 GM Seed. The code below would crash on dict[String(describing: type)] = type // Dictionary to lookup subclass type from its name
static let typeLookup: [String: FeedItem.Type] = {
var dict: [String: FeedItem.Type] = [:]
for type in supportedClasses {
dict[String(describing: type)] = type
}
return dict
}() |
Comment by Tom Quist (JIRA) Nimble is most likely also affected: Quick/Nimble#708 |
Comment by Yunhao (JIRA) I have the same issue when using SPM in my iOS project. The project works well in Xcode 11.0 but crashes when immigrating to Xcode 11.2.1. At the moment, set `DEAD_CODE_STRIPPING` to `No` solves this issue temporarily. Hope next version of Xcode can fix this issue. I like SPM. |
Comment by Igor Vasilev (JIRA) The issue is also reproducible when the project is built under Xcode 11.1, uploaded to TestFlight with Bitcode enabled. 'DEAD_CODE_STRIPPING' seems to be fixing the problem |
Comment by Randy R (JIRA)
|
Comment by Jorge Revuelta Herrero (JIRA) So is this solved...?❓ |
I think this is also apple/swift-nio#1294 |
It is fixed in Xcode11.3 (11C29) release version. |
Comment by Kyle Fox (JIRA) We're still seeing this issue in Xcode 11.3.1 (11C505), but only on iOS 9 and iOS 10 devices. Setting |
Comment by Greg Jeckell (JIRA) We're experiencing this issue in Xcode 11.3.1 (11C504) on all devices. The |
Comment by Tigran Hambardzumyan (JIRA) It is fixed for me in Xcode11.4.1(11E503a) release version. |
Seems like still this affects to dSYM generation. |
Comment by vaux (JIRA) We are still experiencing this issue in Xcode 12.2 (12B45b), on devices with iOS 9 and iOS 10. Can be avoided for Debug builds by setting: |
Seeing this bug in Xcode 13.0 beta (13A5155e) :/ |
xcode13.4 |
How to set DEAD_CODE_STRIPPING=No in Pacakge.swift for dependency? |
Attachment: Download
Environment
DEVICE AND DEVICE SIM ONLY
iOS 13.2 beta 2 and Xcode 11.2 beta 2. macOS Catalina (19A583)
Additional Detail from JIRA
md5: 04e37cf1c97866cec56b34ddb716aad1
is duplicated by:
Issue Description:
Hi,
I'm running iOS 13.2 beta 2 and Xcode 11.2 beta 2.
It appears that – when running on device or device simulator – some generic types module symbols aren't being exported.
For example: When testing the following class as part of a SPM project:
With the following test:
I'm getting a bad access error.
Although I've used an SPM project as an example, I believe it's occurring with any module export. (I'm seeing other similar bad access crashes in other code.)
In fact, you can see with the example above (and SPM project attached) that I'm not using the `@testable` attribute to import the module for the test – I've just made the relevant API in the test class public. (Though, it also crashes with the default access modifiers and using the `@testable` attribute.)
The text was updated successfully, but these errors were encountered: