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-11153] Segmentation fault: 11 when using multiple protocols with Self constraints #53550
Comments
It doesn't crash for me on the master branch, where I get the following warning: typealias overriding associated type 'Field' from protocol 'VectorSpace' is better expressed as same-type constraint on the protocol |
Even in the version without the typealias? I'm seeing a crash in @swift-ci create |
Comment by Maximilian Hünenberger (JIRA) I just tested on Xcode 11.0 beta 4 and it still produces the segmentation fault. |
Sorry, I tried with `-emit-ir` and both examples didn't cause a segfault, but yeah, when compiling normally it crashes in `emitArchetypeWitnessTableRef` as you mentioned. Sorry for the false alarm! |
Comment by Maximilian Hünenberger (JIRA) I tested it again on Xcode 11.0 beta 5 and it still produces a "Segmentation fault: 11" and after a clean build additionally "Command CompileSwift failed with a nonzero exit code". |
I've been hitting a similar (same?) crasher for months now and finally had a few cycles to narrow it down. My case only happens if there are multiple source files, though, so it might not be exactly the same (still crashes in `emitArchetypeWitnessTableRef`. This crashes for me still in Xcode 11.0 GM2 (11A420a). In one file: protocol Snapshotting {
associatedtype NativeType: NativeInserting where NativeType.SnapshotType == Self
associatedtype ChangeType: SnapshotChange where ChangeType.SnapshotType == Self
}
protocol NativeInserting {
associatedtype SnapshotType : Snapshotting where SnapshotType.NativeType == Self
}
protocol SnapshotProperties : OptionSet where RawValue == Int {
static var all: Self { get }
}
protocol SnapshotChange {
associatedtype SnapshotType : Snapshotting where SnapshotType.ChangeType == Self
associatedtype PropertiesType : SnapshotProperties
} and in the other file: class WatchRegistry {
func single<S: Snapshotting>(objectType: S.Type) throws -> Watch<S>
{
return try Watch<S>.singleObject(objectType: S.self, properties: S.ChangeType.PropertiesType.all)
}
}
class Watch<SnapshotType : Snapshotting> {
static func singleObject(objectType: SnapshotType.Type, properties: SnapshotType.ChangeType.PropertiesType) throws -> Watch<SnapshotType> {
fatalError()
}
} |
Environment
Xcode 11.0 beta 3, beta 4 and beta 5 using "Swift 5" as "Swift Language Version"
Additional Detail from JIRA
md5: 1cfc1409d7950524b30cb3f47f9f9e83
Issue Description:
The following code produces a Segmentation fault: 11:
It still produces the Segmentation fault if you change the protocol FieldAlgebra to
The text was updated successfully, but these errors were encountered: