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-9022] Code completion crash in swift::GenericParamKey::findIndexIn #51525

Closed
nathawes opened this issue Oct 17, 2018 · 2 comments
Closed
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 crash Bug: A crash, i.e., an abnormal termination of software source tooling Area: IDE support, SourceKit, and other source tooling

Comments

@nathawes
Copy link
Collaborator

Previous ID SR-9022
Radar rdar://problem/45328122
Original Reporter @nathawes
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s CodeCompletion
Labels Bug, CompilerCrash
Assignee None
Priority Medium

md5: d7e067e69f24011c7e9da17435122bc4

Issue Description:

To reproduce:

$ git clone https://github.com/davecom/SwiftGraph.git 
$ cd SwiftGraph 
$ git checkout -f 6c8c5d699db17f3726776656a09f058bb29d76ec 
$ open SwiftGraph.xcodeproj 
{code} Then in Xcode: 
# Select the October 3 swift.org dev snapshot toolchain 
# Select the "SwiftGraph > My Mac" scheme + dest 
# Navigate to Graph.swift # On line 287 add a space after the "i" in "public subscript(i: Int) -> V {" and invoke code completion to trigger the crash below: 
 

Thread 3 Crashed:
0 com.apple.SourceKitService.4.2.2018100301_osx 0x00000001023e98cc swift::GenericParamKey::findIndexIn(swift::ArrayRefView<swift::Type, swift::GenericTypeParamType*, swift::GenericTypeParamType* swift::staticCastHelper<swift::GenericTypeParamType>(swift::Type const&), true>) const + 12
1 com.apple.SourceKitService.4.2.2018100301_osx 0x00000001023fea0d swift::GenericSignatureBuilder::maybeResolveEquivalenceClass(swift::Type, swift::ArchetypeResolutionKind, bool) + 237
2 com.apple.SourceKitService.4.2.2018100301_osx 0x00000001024155d3 llvm::Optional<swift::Type> llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>::callback_fn<resolveDependentMemberTypes(swift::GenericSignatureBuilder&, swift::Type)::$_69>(long, swift::TypeBase*) + 259
3 com.apple.SourceKitService.4.2.2018100301_osx 0x00000001024790a6 swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 214
4 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010247929c swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 716
5 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010247929c swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 716
6 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010241561c llvm::Optional<swift::Type> llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>::callback_fn<resolveDependentMemberTypes(swift::GenericSignatureBuilder&, swift::Type)::$_69>(long, swift::TypeBase*) + 332
7 com.apple.SourceKitService.4.2.2018100301_osx 0x00000001024790a6 swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 214
8 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010247929c swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 716
9 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010247929c swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 716
10 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010241561c llvm::Optional<swift::Type> llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>::callback_fn<resolveDependentMemberTypes(swift::GenericSignatureBuilder&, swift::Type)::$_69>(long, swift::TypeBase*) + 332
11 com.apple.SourceKitService.4.2.2018100301_osx 0x00000001024790a6 swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 214
12 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010247929c swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 716
13 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010247929c swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 716
14 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010241561c llvm::Optional<swift::Type> llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>::callback_fn<resolveDependentMemberTypes(swift::GenericSignatureBuilder&, swift::Type)::$_69>(long, swift::TypeBase*) + 332
15 com.apple.SourceKitService.4.2.2018100301_osx 0x00000001024790a6 swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 214
16 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010247929c swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 716
17 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010247929c swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 716
18 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010241561c llvm::Optional<swift::Type> llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>::callback_fn<resolveDependentMemberTypes(swift::GenericSignatureBuilder&, swift::Type)::$_69>(long, swift::TypeBase*) + 332
19 com.apple.SourceKitService.4.2.2018100301_osx 0x00000001024790a6 swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 214
20 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010247929c swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 716
21 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010247929c swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 716
22 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010241561c llvm::Optional<swift::Type> llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>::callback_fn<resolveDependentMemberTypes(swift::GenericSignatureBuilder&, swift::Type)::$_69>(long, swift::TypeBase*) + 332
23 com.apple.SourceKitService.4.2.2018100301_osx 0x00000001024790a6 swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 214
24 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010247929c swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 716
25 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010247929c swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 716
26 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010241561c llvm::Optional<swift::Type> llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>::callback_fn<resolveDependentMemberTypes(swift::GenericSignatureBuilder&, swift::Type)::$_69>(long, swift::TypeBase*) + 332
27 com.apple.SourceKitService.4.2.2018100301_osx 0x00000001024790a6 swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 214
28 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010247929c swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 716
29 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010247929c swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 716
30 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010241561c llvm::Optional<swift::Type> llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>::callback_fn<resolveDependentMemberTypes(swift::GenericSignatureBuilder&, swift::Type)::$_69>(long, swift::TypeBase*) + 332
31 com.apple.SourceKitService.4.2.2018100301_osx 0x00000001024790a6 swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 214
32 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010247929c swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 716
33 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010247929c swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 716
34 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010241561c llvm::Optional<swift::Type> llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>::callback_fn<resolveDependentMemberTypes(swift::GenericSignatureBuilder&, swift::Type)::$_69>(long, swift::TypeBase*) + 332
35 com.apple.SourceKitService.4.2.2018100301_osx 0x00000001024790a6 swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 214
36 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010247929c swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 716
37 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010247929c swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 716
38 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010241561c llvm::Optional<swift::Type> llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>::callback_fn<resolveDependentMemberTypes(swift::GenericSignatureBuilder&, swift::Type)::$_69>(long, swift::TypeBase*) + 332
39 com.apple.SourceKitService.4.2.2018100301_osx 0x00000001024790a6 swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 214
40 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010247929c swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 716
41 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010247929c swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 716
42 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010241561c llvm::Optional<swift::Type> llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>::callback_fn<resolveDependentMemberTypes(swift::GenericSignatureBuilder&, swift::Type)::$_69>(long, swift::TypeBase*) + 332
43 com.apple.SourceKitService.4.2.2018100301_osx 0x00000001024790a6 swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 214
44 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010247929c swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 716
45 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010247929c swift::Type::transformRec(llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>) const + 716
46 com.apple.SourceKitService.4.2.2018100301_osx 0x000000010241561c llvm::Optional<swift::Type> llvm::function_ref<llvm::Optional<swift::Type> (swift::TypeBase*)>::callback_fn<resolveDependentMemberTypes(swift::GenericSignatureBuilder&, swift::Type)::$_69>(long, swift::TypeBase*) + 332
...

@nathawes
Copy link
Collaborator Author

@swift-ci create

@slavapestov
Copy link
Member

#20119

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added crash Bug: A crash, i.e., an abnormal termination of software compiler The Swift compiler in itself labels Dec 12, 2022
@AnthonyLatsis AnthonyLatsis added the source tooling Area: IDE support, SourceKit, and other source tooling label Feb 6, 2023
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. code completion Area → source tooling: code completion compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software source tooling Area: IDE support, SourceKit, and other source tooling
Projects
None yet
Development

No branches or pull requests

3 participants