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-8007] SIL crash on capture list #50540

Closed
swift-ci opened this issue Jun 15, 2018 · 2 comments
Closed

[SR-8007] SIL crash on capture list #50540

swift-ci opened this issue Jun 15, 2018 · 2 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 type checker Area → compiler: Semantic analysis

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-8007
Radar None
Original Reporter linqingmo (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate
Environment

Xcode 9.4.1

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

md5: c734966eaff19af57abaec3c02ca1bc9

duplicates:

  • SR-5870 Crash when capture list references parameter of outer single-expression closure

Issue Description:

class T {
    var handler1: ((T) -> Void)?
    var handler2: (() -> Void)?
}

let t = T()
t.handler1 = { tt in
    tt.handler2 = { [unowned tt] in
        print(tt)
    }
}
will crash

0  swift                    0x0000000110fc5c5a PrintStackTraceSignalHandler(void*) + 42
1  swift                    0x0000000110fc5066 SignalHandler(int) + 966
2  libsystem_platform.dylib 0x00007fff6d746f5a _sigtramp + 26
3  libsystem_platform.dylib 0x00007ffee29e6140 _sigtramp + 1965683200
4  swift                    0x000000010dbff26f swift::ASTVisitor<swift::Lowering::SILGenModule, void, void, void, void, void, void>::visit(swift::Decl*) + 399
5  swift                    0x000000010dbfe16b swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*, unsigned int) + 939
6  swift                    0x000000010dbffd05 swift::SILModule::constructSIL(swift::ModuleDecl*, swift::SILOptions&, swift::FileUnit*, llvm::Optional<unsigned int>, bool) + 1333
7  swift                    0x000000010d29f7ee performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 29166
8  swift                    0x000000010d29510f swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 7839
9  swift                    0x000000010d23ec48 main + 13144
10 libdyld.dylib            0x00007fff6d438015 start + 1
11 libdyld.dylib            0x0000000000000044 start + 2461827120

a workaround
t.handler1 = { tt in
    let tt = tt
    tt.handler2 = { [unowned tt] in
        print(tt)
    }
}
@belkadan
Copy link
Contributor

Possibly the same as SR-3186? @rudkx?

@rudkx
Copy link
Member

rudkx commented Jun 15, 2018

Yes we have various dips of this including https://bugs.swift.org/plugins/servlet/mobile#issue/SR-5870 which was resolved recently by @xedin.

@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 type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

4 participants