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-11061] Abort 6: Property wrapper with closure #53453

Closed
Agarunov opened this issue Jul 2, 2019 · 4 comments
Closed

[SR-11061] Abort 6: Property wrapper with closure #53453

Agarunov opened this issue Jul 2, 2019 · 4 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software property wrappers Feature: property wrappers

Comments

@Agarunov
Copy link

Agarunov commented Jul 2, 2019

Previous ID SR-11061
Radar rdar://problem/52593304
Original Reporter @Agarunov
Type Bug
Status Closed
Resolution Done
Environment

Xcode 11.0 beta 3 (11M362v)

Toolchain: Swift 5.1 Snapshot 2019-07-01 (a)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, PropertyWrappers
Assignee None
Priority Medium

md5: 6f92f3441d351e421097e4b960a957af

Issue Description:

This code crashes:

class Value {
    @A(closure: { $0 }) var some: Int = 100
}

@propertyWrapper
struct A<T> {
    var wrappedValue: T
    let closure: (T) -> (T)

    init(initialValue: T, closure: @escaping (T) -> (T)) {
        self.wrappedValue = initialValue
        self.closure = closure
    }
}
Assertion failed: (DC == closure->getParent() && "Decl context isn't correct"), function walkToClosureExprPre, file /Users/buildnode/jenkins/workspace/oss-swift-5.1-package-osx/swift/lib/Sema/TypeCheckConstraints.cpp, line 1389.0  swift                    0x000000010864d1d5 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  swift                    0x000000010864c4c5 llvm::sys::RunSignalHandlers() + 85
2  swift                    0x000000010864d7b8 SignalHandler(int) + 264
3  libsystem_platform.dylib 0x00007fff6d852b5d _sigtramp + 29
4  swift                    0x000000010a9725b8 cmark_strbuf__initbuf + 129411
5  libsystem_c.dylib        0x00007fff6d70c6a6 abort + 127
6  libsystem_c.dylib        0x00007fff6d6d520d basename_r + 0
7  swift                    0x000000010898f463 (anonymous namespace)::PreCheckExpression::walkToExprPre(swift::Expr*) (.cold.3) + 35
8  swift                    0x00000001057a7841 (anonymous namespace)::PreCheckExpression::walkToExprPre(swift::Expr*) + 2193
9  swift                    0x0000000105a8d0aa swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Expr*) + 4362
10 swift                    0x0000000105a8ea7f (anonymous namespace)::Traversal::visitApplyExpr(swift::ApplyExpr*) + 207
11 swift                    0x0000000105a8ba11 swift::Expr::walk(swift::ASTWalker&) + 81
12 swift                    0x000000010579bbb7 swift::TypeChecker::typeCheckExpressionImpl(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener&, swift::constraints::ConstraintSystem*) + 327
13 swift                    0x000000010579ba5f swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener*, swift::constraints::ConstraintSystem*) + 63
14 swift                    0x0000000105714e20 typeCheckSynthesizedWrapperInitializer(swift::PatternBindingDecl*, swift::VarDecl*, swift::PatternBindingDecl*, swift::Expr*&) + 112
15 swift                    0x0000000105714cae swift::PropertyWrapperBackingPropertyInfoRequest::evaluate(swift::Evaluator&, swift::VarDecl*) const + 3742
16 swift                    0x000000010582a5b1 swift::SimpleRequest<swift::PropertyWrapperBackingPropertyInfoRequest, (swift::CacheKind)1, swift::PropertyWrapperBackingPropertyInfo, swift::VarDecl*>::evaluateRequest(swift::PropertyWrapperBackingPropertyInfoRequest const&, swift::Evaluator&) + 17
17 swift                    0x0000000105ad8014 llvm::Expected<swift::PropertyWrapperBackingPropertyInfoRequest::OutputType> swift::Evaluator::getResultUncached<swift::PropertyWrapperBackingPropertyInfoRequest>(swift::PropertyWrapperBackingPropertyInfoRequest const&) + 372
18 swift                    0x0000000105ad7b15 llvm::Expected<swift::PropertyWrapperBackingPropertyInfoRequest::OutputType> swift::Evaluator::getResultCached<swift::PropertyWrapperBackingPropertyInfoRequest, (void*)0>(swift::PropertyWrapperBackingPropertyInfoRequest const&) + 277
19 swift                    0x0000000105ad70d7 llvm::Expected<swift::PropertyWrapperBackingPropertyInfoRequest::OutputType> swift::Evaluator::operator()<swift::PropertyWrapperBackingPropertyInfoRequest>(swift::PropertyWrapperBackingPropertyInfoRequest const&) + 119
20 swift                    0x0000000105abf3ad swift::PropertyWrapperBackingPropertyInfoRequest::OutputType swift::evaluateOrDefault<swift::PropertyWrapperBackingPropertyInfoRequest>(swift::Evaluator&, swift::PropertyWrapperBackingPropertyInfoRequest, swift::PropertyWrapperBackingPropertyInfoRequest::OutputType) + 29
21 swift                    0x0000000105abf598 swift::VarDecl::getPropertyWrapperBackingProperty() const + 120
22 swift                    0x000000010571503b swift::maybeAddAccessorsToStorage(swift::AbstractStorageDecl*) + 155
23 swift                    0x00000001057c4ba8 void llvm::function_ref<void (swift::VarDecl*)>::callback_fn<(anonymous namespace)::DeclChecker::visitBoundVars(swift::Pattern*)::'lambda'(swift::VarDecl*)>(long, swift::VarDecl*) + 40
24 swift                    0x00000001057b342f (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 1855
25 swift                    0x00000001057bf63b (anonymous namespace)::DeclChecker::visitClassDecl(swift::ClassDecl*) + 267
26 swift                    0x00000001057b3007 (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 791
27 swift                    0x00000001057b2ce6 swift::TypeChecker::typeCheckDecl(swift::Decl*) + 38
28 swift                    0x000000010584e5a9 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) + 953
29 swift                    0x00000001050190b1 swift::CompilerInstance::parseAndCheckTypesUpTo(swift::CompilerInstance::ImplicitImports const&, swift::SourceFile::ASTStage_t)::$_1::operator()(swift::SourceFile&) const + 81
30 swift                    0x0000000105014bab swift::CompilerInstance::parseAndCheckTypesUpTo(swift::CompilerInstance::ImplicitImports const&, swift::SourceFile::ASTStage_t) + 507
31 swift                    0x00000001050144aa swift::CompilerInstance::performSemaUpTo(swift::SourceFile::ASTStage_t) + 618
32 swift                    0x0000000104e0280e performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 1678
33 swift                    0x0000000104e0125a swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3002
34 swift                    0x0000000104daa0c8 main + 696
35 libdyld.dylib            0x00007fff6d6673d5 start + 1
error: Abort trap: 6
@belkadan
Copy link
Contributor

belkadan commented Jul 3, 2019

@swift-ci create

@DougGregor
Copy link
Member

Fixed by #26012

@AnnaZaks
Copy link
Mannequin

AnnaZaks mannequin commented Aug 9, 2019

@Agarunov, Could you verify if the problem is fixed and if so move the JIRA to "Closed"?

Thanks!
Anna"

@Agarunov
Copy link
Author

Agarunov commented Aug 9, 2019

This problem is fixed, but I found bug with fix-it described in SR-11277

Thanks!

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software property wrappers Feature: property wrappers
Projects
None yet
Development

No branches or pull requests

4 participants