swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
66.77k stars 10.29k forks source link

[SR-10067] Sourcekitd crashed making a CursorInfo request #52469

Open kateinoigakukun opened 5 years ago

kateinoigakukun commented 5 years ago
Previous ID SR-10067
Radar None
Original Reporter @kateinoigakukun
Type Bug
Environment macOS: 10.14.3(18D109) Toolchain: swift-DEVELOPMENT-SNAPSHOT-2019-03-04-a.xctoolchain
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | Source Tooling | |Labels | Bug, FoundByStressTester | |Assignee | None | |Priority | Medium | md5: 3e7a7ae3e8233b062703a66b9ba7e494

Issue Description:

Detected unexpected failure: SourceKit crashed
 request: CursorInfo in /Users/kateinoigakukun/projects/stress-tester/Sources/stress-tester/stress_tester.swift (modified: concurrent) at offset 201 with args: -module-name stress_tester -incremental -emit-dependencies -emit-module -emit-module-path /Users/kateinoigakukun/projects/stress-tester/.build/x86_64-apple-macosx/debug/stress_tester.swiftmodule -output-file-map /Users/kateinoigakukun/projects/stress-tester/.build/x86_64-apple-macosx/debug/stress_tester.build/output-file-map.json -parse-as-library -c /Users/kateinoigakukun/projects/stress-tester/Sources/stress-tester/stress_tester.swift -I /Users/kateinoigakukun/projects/stress-tester/.build/x86_64-apple-macosx/debug -target x86_64-apple-macosx10.10 -swift-version 5 -enable-batch-mode -index-store-path /Users/kateinoigakukun/projects/stress-tester/.build/x86_64-apple-macosx/debug/index/store -sdk /Applications/Xcode-10.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -F /Applications/Xcode-10.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -Onone -g -enable-testing -j8 -DSWIFT_PACKAGE -DDEBUG -module-cache-path /Users/kateinoigakukun/projects/stress-tester/.build/x86_64-apple-macosx/debug/ModuleCache -Xfrontend -color-diagnostics
-- begin file content --------
protocol P1 {}
protocol P2 {
 associatedtype X:

protocol P3 {
 associatedtype Y:

struct S: P1 {}
struct T: P2 {
 typealias
struct U: P3 {
 typealias

struct A<B> {

func main() {
 <cursor-offset>A
-- end file content ----------

The content of source is below.

protocol P1 {}
protocol P2 {
    associatedtype X: P1
}

protocol P3 {
    associatedtype Y: P2
}

struct S: P1 {}
struct T: P2 {
    typealias X = S
}
struct U: P3 {
    typealias Y = T
}

struct A<B> {

    func foo<C: P3>(_: C) where C.Y == B {}
}

func main() {
    A.foo(A<T>())(U())
}
belkadan commented 5 years ago

cc @nkcsgexi, @nathawes