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-10933] Property wrappers class hierarchy compiler crash #53324

Closed
Agarunov opened this issue Jun 15, 2019 · 3 comments
Closed

[SR-10933] Property wrappers class hierarchy compiler crash #53324

Agarunov opened this issue Jun 15, 2019 · 3 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

Previous ID SR-10933
Radar rdar://problem/51810057
Original Reporter @Agarunov
Type Bug
Status Closed
Resolution Done

Attachment: Download

Environment

Xcode 11 beta 1, Swift toolchain #25478

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

md5: 33fe687c57163783b768a7c1b4264072

Issue Description:

I have project with this files.

// Wrapper.swift

@propertyDelegate
class Wrapper<T> {
    
    private var _value: T
    
    var value: T {
        get { _value }
        set { _value = newValue }
    }
    
    init(defaultValue: T) {
        self._value = defaultValue
    }
    
}
// IntWrapper.swift

@propertyDelegate
final class IntWrapper: Wrapper<Int> {
    
    override var value: Int {
        get { super.value }
        set { super.value = newValue }
    }
    
}
// Holder.swift

class Holder {
    @IntWrapper(defaultValue: 100) var int: Int
}
func main() {
    let h = Holder() // compiler crash
}
0  swift                    0x000000010d215fe5 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  swift                    0x000000010d2152d5 llvm::sys::RunSignalHandlers() + 85
2  swift                    0x000000010d2165c8 SignalHandler(int) + 264
3  libsystem_platform.dylib 0x00007fff782e7b5d _sigtramp + 29
4  libsystem_platform.dylib 0x0000000000004120 _sigtramp + 2278671840
5  libsystem_c.dylib        0x00007fff781a16a6 abort + 127
6  libsystem_c.dylib        0x00007fff7816a20d basename_r + 0
7  swift                    0x000000010d638503 swift::AbstractStorageDecl::getValueInterfaceType() const (.cold.4) + 35
8  swift                    0x000000010a67e3c3 swift::AbstractStorageDecl::getValueInterfaceType() const + 147
9  swift                    0x000000010a2e3533 swift::PropertyWrapperBackingPropertyInfoRequest::evaluate(swift::Evaluator&, swift::VarDecl*) const + 659
10 swift                    0x000000010a3ff3a1 swift::SimpleRequest<swift::PropertyWrapperBackingPropertyInfoRequest, (swift::CacheKind)1, swift::PropertyWrapperBackingPropertyInfo, swift::VarDecl*>::evaluateRequest(swift::PropertyWrapperBackingPropertyInfoRequest const&, swift::Evaluator&) + 17
11 swift                    0x000000010a69dcd4 llvm::Expected<swift::PropertyWrapperBackingPropertyInfoRequest::OutputType> swift::Evaluator::getResultUncached<swift::PropertyWrapperBackingPropertyInfoRequest>(swift::PropertyWrapperBackingPropertyInfoRequest const&) + 372
12 swift                    0x000000010a69d7d5 llvm::Expected<swift::PropertyWrapperBackingPropertyInfoRequest::OutputType> swift::Evaluator::getResultCached<swift::PropertyWrapperBackingPropertyInfoRequest, (void*)0>(swift::PropertyWrapperBackingPropertyInfoRequest const&) + 277
13 swift                    0x000000010a69cd97 llvm::Expected<swift::PropertyWrapperBackingPropertyInfoRequest::OutputType> swift::Evaluator::operator()<swift::PropertyWrapperBackingPropertyInfoRequest>(swift::PropertyWrapperBackingPropertyInfoRequest const&) + 119
14 swift                    0x000000010a68054d swift::PropertyWrapperBackingPropertyInfoRequest::OutputType swift::evaluateOrDefault<swift::PropertyWrapperBackingPropertyInfoRequest>(swift::Evaluator&, swift::PropertyWrapperBackingPropertyInfoRequest, swift::PropertyWrapperBackingPropertyInfoRequest::OutputType) + 29
15 swift                    0x000000010a680738 swift::VarDecl::getPropertyWrapperBackingProperty() const + 120
16 swift                    0x000000010a38d43b swift::TypeChecker::addImplicitConstructors(swift::NominalTypeDecl*) + 1435
17 swift                    0x000000010a720e3e swift::DeclContext::lookupQualified(llvm::ArrayRef<swift::NominalTypeDecl*>, swift::DeclName, swift::NLOptions, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 1054
18 swift                    0x000000010a71fc3f swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, swift::NLOptions, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 335
19 swift                    0x000000010a3be3e0 swift::TypeChecker::lookupMember(swift::DeclContext*, swift::Type, swift::DeclName, swift::OptionSet<swift::NameLookupFlags, unsigned int>) + 368
20 swift                    0x000000010a2fc532 swift::constraints::ConstraintSystem::lookupMember(swift::Type, swift::DeclName) + 210
21 swift                    0x000000010a299405 swift::constraints::ConstraintSystem::performMemberLookup(swift::constraints::ConstraintKind, swift::DeclName, swift::Type, swift::FunctionRefKind, swift::constraints::ConstraintLocator*, bool) + 1429
22 swift                    0x000000010a29b49b swift::constraints::ConstraintSystem::simplifyMemberConstraint(swift::constraints::ConstraintKind, swift::Type, swift::DeclName, swift::Type, swift::DeclContext*, swift::FunctionRefKind, llvm::ArrayRef<swift::constraints::OverloadChoice>, swift::OptionSet<swift::constraints::ConstraintSystem::TypeMatchFlags, unsigned int>, swift::constraints::ConstraintLocatorBuilder) + 187
23 swift                    0x000000010a37ab5f swift::constraints::ConstraintSystem::addValueMemberConstraint(swift::Type, swift::DeclName, swift::Type, swift::DeclContext*, swift::FunctionRefKind, llvm::ArrayRef<swift::constraints::OverloadChoice>, swift::constraints::ConstraintLocatorBuilder) + 223
24 swift                    0x000000010a297368 swift::constraints::ConstraintSystem::simplifyConstructionConstraint(swift::Type, swift::FunctionType*, swift::OptionSet<swift::constraints::ConstraintSystem::TypeMatchFlags, unsigned int>, swift::DeclContext*, swift::FunctionRefKind, swift::constraints::ConstraintLocator*) + 856
25 swift                    0x000000010a2a096a swift::constraints::ConstraintSystem::simplifyApplicableFnConstraint(swift::Type, swift::Type, swift::OptionSet<swift::constraints::ConstraintSystem::TypeMatchFlags, unsigned int>, swift::constraints::ConstraintLocatorBuilder) + 2858
26 swift                    0x000000010a28eedf swift::constraints::ConstraintSystem::addConstraint(swift::constraints::ConstraintKind, swift::Type, swift::Type, swift::constraints::ConstraintLocatorBuilder, bool) + 63
27 swift                    0x000000010a28278f (anonymous namespace)::ConstraintGenerator::visitApplyExpr(swift::ApplyExpr*) + 447
28 swift                    0x000000010a27a8b2 (anonymous namespace)::ConstraintWalker::walkToExprPost(swift::Expr*) + 450
29 swift                    0x000000010a64c303 swift::Expr::walk(swift::ASTWalker&) + 115
30 swift                    0x000000010a27664a swift::constraints::ConstraintSystem::generateConstraints(swift::Expr*, swift::DeclContext*) + 426
31 swift                    0x000000010a2b013d swift::constraints::ConstraintSystem::solveImpl(swift::Expr*&, swift::Type, swift::ExprTypeCheckListener*, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 477
32 swift                    0x000000010a2afd0b swift::constraints::ConstraintSystem::solve(swift::Expr*&, swift::Type, swift::ExprTypeCheckListener*, llvm::SmallVectorImpl<swift::constraints::Solution>&, swift::FreeTypeVariableBinding) + 475
33 swift                    0x000000010a36ac74 swift::TypeChecker::typeCheckExpressionImpl(swift::Expr*&, swift::DeclContext*, swift::TypeLoc, swift::ContextualTypePurpose, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>, swift::ExprTypeCheckListener&, swift::constraints::ConstraintSystem*) + 964
34 swift                    0x000000010a36c332 swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*) + 930
35 swift                    0x000000010a36c650 swift::TypeChecker::typeCheckPatternBinding(swift::PatternBindingDecl*, unsigned int) + 192
36 swift                    0x000000010a38aaed validatePatternBindingEntries(swift::TypeChecker&, swift::PatternBindingDecl*) + 781
37 swift                    0x000000010a383a5d (anonymous namespace)::DeclChecker::visit(swift::Decl*) + 1805
38 swift                    0x000000010a383346 swift::TypeChecker::typeCheckDecl(swift::Decl*) + 38
39 swift                    0x000000010a403aaa swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) + 474
40 swift                    0x000000010a402c58 bool (anonymous namespace)::StmtChecker::typeCheckStmt<swift::BraceStmt>(swift::BraceStmt*&) + 136
41 swift                    0x000000010a40188d swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*, swift::SourceLoc) + 493
42 swift                    0x000000010a40239e swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*) + 334
43 swift                    0x000000010a422a87 typeCheckFunctionsAndExternalDecls(swift::SourceFile&, swift::TypeChecker&) + 247
44 swift                    0x000000010a42322d swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) + 1005
45 swift                    0x0000000109bddb61 swift::CompilerInstance::parseAndCheckTypesUpTo(swift::CompilerInstance::ImplicitImports const&, swift::SourceFile::ASTStage_t)::$_1::operator()(swift::SourceFile&) const + 81
46 swift                    0x0000000109bd967b swift::CompilerInstance::parseAndCheckTypesUpTo(swift::CompilerInstance::ImplicitImports const&, swift::SourceFile::ASTStage_t) + 507
47 swift                    0x0000000109bd8f7a swift::CompilerInstance::performSemaUpTo(swift::SourceFile::ASTStage_t) + 618
48 swift                    0x00000001099cd972 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 1730
49 swift                    0x00000001099cc2d1 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3025
50 swift                    0x0000000109975849 main + 729
51 libdyld.dylib            0x00007fff780fc3d5 start + 1
52 libdyld.dylib            0x000000000000004a start + 2280668278
error: Abort trap: 6
@DougGregor
Copy link
Member

Thank you! Fix is here: #25626

@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

The problem is fixed.

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

3 participants