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-13887] Crash (Segmentation fault: 11) #56285

Open
swift-ci opened this issue Nov 22, 2020 · 1 comment
Open

[SR-13887] Crash (Segmentation fault: 11) #56285

swift-ci opened this issue Nov 22, 2020 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-13887
Radar rdar://problem/71677775
Original Reporter ken (JIRA User)
Type Bug
Environment

Xcode "Version 12.0.1 (12A7300)".
Above the stack trace, it says: "Apple Swift version 5.3 (swiftlang-1200.0.29.2 clang-1200.0.30.1)"

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

md5: 654d4c44de8b60abe51e70a344291715

Issue Description:

I was writing a Swift program in Xcode 12 (Swift 5.3), and I started consistently crashing the compiler. I made a copy of the project and started removing pieces until I found what I believe is a fairly minimal example.

I'll prefix this by saying: I know this isn't a valid Swift program. I was adding conformance to a protocol, and I couldn't remember the protocol definition, so I was going to declare conformance and have Xcode show the error with the "Add stubs?" fixer. But it just kept segfaulting.

In file A.swift:

class E {
    func n(_ num: N) { }
}

func test() {
    let e = E()
    e.n(5)
}

In file B.swift:

struct N {
    let str: String

    init(_ int: Int) {
        self.str = String(int)
    }
}

extension N: ExpressibleByIntegerLiteral {

}

Curiously, Xcode reports "Command CompileSwift failed with a nonzero exit code", but changing almost any remaining aspect of this program (for example, commenting out the "self.str = String(int)" line, or the "e.n(5)" line, or even putting all the code in one file) changes the error to "Type 'N' does not conform to protocol 'ExpressibleByIntegerLiteral'" – which is what I expected in the first place.

@typesanitizer
Copy link

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
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
Projects
None yet
Development

No branches or pull requests

2 participants