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-12501] Override a property wrapper variable to add didSet crashes #54943
Comments
This seems similar to recently fixed SR-12443, just tested seems fixed on master |
Yup, this has been fixed on master, please verify using the next available development snapshot from https://swift.org/download/#snapshots. |
Comment by David L. Edwards (JIRA) I tested my test case project against the Swift 5.2 Snapshot 2020-04-07 (Swift a543bfb). The crash remains. 1. Apple Swift version 5.2.2-dev (Swift a543bfb) 2. While evaluating request TypeCheckSourceFileRequest(source_file "/Users/dlemex/Downloads/project/ThreadSafeTest/StatusSingleton.swift", 0) 3. While evaluating request TypeCheckFunctionBodyUntilRequest(ThreadSafeTest.(file).StatusSingleton._@/Users/dlemex/Downloads/project/ThreadSafeTest/StatusSingleton.swift:24:25, ) 4. While type-checking setter for isStatusEnabled (at /Users/dlemex/Downloads/project/ThreadSafeTest/StatusSingleton.swift:24:25) 5. While evaluating request ParseAbstractFunctionBodyRequest(ThreadSafeTest.(file).StatusSingleton._@/Users/dlemex/Downloads/project/ThreadSafeTest/StatusSingleton.swift:24:25) 0 swift 0x0000000104569138 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40 1 swift 0x0000000104568355 llvm::sys::RunSignalHandlers() + 85 2 swift 0x0000000104569710 SignalHandler(int) + 272 3 libsystem_platform.dylib 0x00007fff712115fd _sigtramp + 29 4 libsystem_platform.dylib 0x0000000000004e68 _sigtramp + 2396993672 5 libsystem_c.dylib 0x00007fff710e7808 abort + 120 6 libsystem_c.dylib 0x00007fff710e6ac6 err + 0 7 swift 0x000000010481ba01 swift::buildSelfReference(swift::VarDecl*, swift::SelfAccessorKind, bool, swift::ASTContext&) (.cold.1) + 33 8 swift 0x000000010128c560 swift::buildArgumentForwardingExpr(llvm::ArrayRef<swift::ParamDecl*>, swift::ASTContext&) + 0 9 swift 0x00000001013d06a7 buildStorageReference(swift::AccessorDecl*, swift::AbstractStorageDecl*, (anonymous namespace)::TargetImpl, bool, swift::ASTContext&) + 951 10 swift 0x00000001013d1b33 synthesizeObservedSetterBody(swift::AccessorDecl*, (anonymous namespace)::TargetImpl, swift::ASTContext&) + 291 11 swift 0x00000001013cf71e synthesizeAccessorBody(swift::AbstractFunctionDecl*, void*) + 3118 12 swift 0x000000010158ba66 swift::ParseAbstractFunctionBodyRequest::evaluate(swift::Evaluator&, swift::AbstractFunctionDecl*) const + 294 13 swift 0x000000010158bb31 swift::SimpleRequest<swift::ParseAbstractFunctionBodyRequest, swift::BraceStmt* (swift::AbstractFunctionDecl*), (swift::CacheKind)2>::evaluateRequest(swift::ParseAbstractFunctionBodyRequest const&, swift::Evaluator&) + 17 14 swift 0x000000010172b591 llvm::Expected<swift::ParseAbstractFunctionBodyRequest::OutputType> swift::Evaluator::getResultUncached<swift::ParseAbstractFunctionBodyRequest>(swift::ParseAbstractFunctionBodyRequest const&) + 465 15 swift 0x000000010172b2c8 llvm::Expected<swift::ParseAbstractFunctionBodyRequest::OutputType> swift::Evaluator::getResultCached<swift::ParseAbstractFunctionBodyRequest, (void*)0>(swift::ParseAbstractFunctionBodyRequest const&) + 72 16 swift 0x00000001016d7353 swift::ParseAbstractFunctionBodyRequest::OutputType swift::evaluateOrDefault<swift::ParseAbstractFunctionBodyRequest>(swift::Evaluator&, swift::ParseAbstractFunctionBodyRequest, swift::ParseAbstractFunctionBodyRequest::OutputType) + 35 |
dlemex (JIRA User) You need to download the master (trunk) snapshot, not the Swift 5.2 snapshot (as the fix wasn't merged into the 5.2 branch). |
@swift-ci create |
dlemex (JIRA User) As Suyash says, you need to test against a master development snapshot. I'm going to mark the issue as resolved again, but please do feel free to re-open if it's still reproducible on a master snapshot. |
Attachment: Download
Environment
Xcode 10.4, Swift 5.2
Additional Detail from JIRA
md5: 3e2227a51754302ab911ba5dda6de271
duplicates:
Issue Description:
I have a simple property wrapper that implements thread safety using GCD. In order to add didSet to the property wrapped variables, I subclassed the object, then defines overrides of the wrapped variable and adds a didSet. When swift attempts to compile the module it traps with an illegal instruction 4.
Removing the override and the code complies just fine. This was working correctly in swift 5.1.3.
Reported to Apple: FB7615016
The text was updated successfully, but these errors were encountered: