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-7309] Compiler crash : Segfault compiling closure with guard let self = self #49857

Closed
swift-ci opened this issue Mar 29, 2018 · 3 comments
Closed
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-7309
Radar rdar://problem/39040593
Original Reporter damonallison (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Xcode Version 9.3 beta 4 (9Q127n)

/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -v
Apple Swift version 4.1 (swiftlang-902.0.43 clang-902.0.37.1)
Target: x86_64-apple-darwin17.4.0

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

md5: 3e1bae25fc2a85cb338683a4c729cc79

Issue Description:

I ran into this randomly experimenting with closure capture lists while reading The Swift Programming Language.

Run Cmd-U from Xcode with the attached project to reproduce.

1.  While type-checking getter for asHTMLWeak at /Users/allidam/projects/swift-fundamentals/SwiftFundamentals-Tests/Language/MemoryManagementTests.swift:183:22

2.  While type-checking declaration 0x7f939f6e82b0 in module 'SwiftFundamentals_Tests'

3.  While type-checking expression at [/Users/allidam/projects/swift-fundamentals/SwiftFundamentals-Tests/Language/MemoryManagementTests.swift:183:49 - line:193:13] RangeText="{ [weak self] in

                guard let self = self else {

                    return "Unknown"

                }

                if let text = self.text {

                    return "<\(self.name)>\(text)</\(self.name)>"

                }

                else {

                    return "<\(self.name) />"

                }

            }"

4.  While type-checking pattern at [/Users/allidam/projects/swift-fundamentals/SwiftFundamentals-Tests/Language/MemoryManagementTests.swift:184:27 - line:184:27] RangeText="s"

5.  While type-checking expression at [/Users/allidam/projects/swift-fundamentals/SwiftFundamentals-Tests/Language/MemoryManagementTests.swift:184:27 - line:184:27] RangeText="s"

error: Segmentation fault: 11
@belkadan
Copy link
Contributor

@swift-ci create

@xedin
Copy link
Member

xedin commented Apr 5, 2018

Thank you for the report, damonallison (JIRA User)![]( Looks like this crash has been fixed recently, please use snapshot of trunk to verify) I've created PR #15775 to add minimized test-case to your regression suite.

@swift-ci
Copy link
Collaborator Author

Comment by Damon Allison (JIRA)

Verified this has been resolved. Thank you much, @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