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-13606] Swift Build fail with Error Segmentation fault: 11 #56041

Open
swift-ci opened this issue Sep 25, 2020 · 3 comments
Open

[SR-13606] Swift Build fail with Error Segmentation fault: 11 #56041

swift-ci opened this issue Sep 25, 2020 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. code completion Area → source tooling: code completion compiler The Swift compiler in itself source tooling Area: IDE support, SourceKit, and other source tooling

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-13606
Radar rdar://problem/69549214
Original Reporter miku1958 (JIRA User)
Type Bug

Attachment: Download

Environment

macOS 10.15.6
Xcode 12.2 beta

Additional Detail from JIRA
Votes 0
Component/s CodeCompletion, Compiler
Labels Bug
Assignee miku1958 (JIRA)
Priority Medium

md5: 96551868b73c577121953990fee850b6

Issue Description:

I removed the old description, and replaced the test project with a shortened version.

Xcode 12 builds with code like these will crash, including the 12.0 - 12.3 beta.

{code: swift}
@propertyWrapper
final class AlterKeys<T> {

public var wrappedValue: T

public init(wrappedValue: @escaping @autoclosure () -> T, _ codingKeys: String...) {
self.wrappedValue = wrappedValue()
}
}
struct A {
// build fail in Xcode 12
@alterKeys("abc")
var key: Int = 0
}

But using the latest Swift snapshot from swift.org in Xcode will build successfully.

Then If I add another initialize function to the AlterKeys, It will build successfully too, like:
{code:swift}
@propertyWrapper
final class alterKeys<T> {
    
    public var wrappedValue: T
    
    public init(wrappedValue: @escaping @autoclosure () -> T, _ codingKeys: String...) {
        self.wrappedValue = wrappedValue()
    }
    public init(wrappedValue: @escaping @autoclosure () -> T) {
        self.wrappedValue = wrappedValue()
    }
}
struct A {
    // build success in Xcode 12
    @alterKeys("abc")
    var key: Int = 0
}
@typesanitizer
Copy link

@swift-ci create

@jckarter
Copy link
Member

@eeckstein gave this a try in the main branch and it looks like it works now. You could try a main branch snapshot from swift.org to see if the problem is resolved for you in your actual project.

@swift-ci
Copy link
Collaborator Author

Comment by 庄黛淳华 (JIRA)

The building crash issue still not fix in Xcode 12.2 and 12.3 beta(Apple Swift version 5.3.2 (swiftlang-1200.0.44.1 clang-1200.0.32.28))

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the source tooling Area: IDE support, SourceKit, and other source tooling label Feb 6, 2023
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. code completion Area → source tooling: code completion compiler The Swift compiler in itself source tooling Area: IDE support, SourceKit, and other source tooling
Projects
None yet
Development

No branches or pull requests

4 participants