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-11697] SourceKit hits assertion on incomplete generic function inside generic class #54105

Closed
nathawes opened this issue Nov 2, 2019 · 2 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software found by stress tester Flag: An issue found by the SourceKit stress tester

Comments

@nathawes
Copy link
Collaborator

nathawes commented Nov 2, 2019

Previous ID SR-11697
Radar rdar://problem/56834530
Original Reporter @nathawes
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Source Tooling
Labels Bug, Crash, FoundByStressTester
Assignee @nathawes
Priority Medium

md5: 740cc0ac800163a79804ca3cbc7ac23e

Issue Description:

Reproducer:

class Chain<A> {
func + <T:

Trace:

Assertion failed: (resolver && "Need to resolve generic parameter depth"), function computeCanonicalType, file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/lib/AST/Type.cpp, line 1150.

Thread 1 Crashed:: Dispatch queue: com.apple.root.default-qos
0   libsystem_kernel.dylib          0x00007fff5ee6f2c6 __pthread_kill + 10
1   libsystem_pthread.dylib         0x00007fff5ef2abf1 pthread_kill + 284
2   libsystem_c.dylib               0x00007fff5edd9745 __abort + 144
3   libsystem_c.dylib               0x00007fff5edd96b5 abort + 142
4   libsystem_c.dylib               0x00007fff5eda220d __assert_rtn + 324
5   com.apple.SourceKitService.5.0.20191024101_osx  0x000000010a819aa3 swift::TypeBase::computeCanonicalType() (.cold.12) + 35
6   com.apple.SourceKitService.5.0.20191024101_osx  0x0000000108761fc7 swift::TypeBase::computeCanonicalType() + 3671
7   com.apple.SourceKitService.5.0.20191024101_osx  0x00000001087617f6 swift::TypeBase::computeCanonicalType() + 1670
8   com.apple.SourceKitService.5.0.20191024101_osx  0x000000010875d92c swift::TypeBase::isEqual(swift::Type) + 76
9   com.apple.SourceKitService.5.0.20191024101_osx  0x00000001086cacb6 swift::DiagnosticEngine::formatDiagnosticText(llvm::raw_ostream&, llvm::StringRef, llvm::ArrayRef<swift::DiagnosticArgument>, swift::DiagnosticFormatOptions) + 4726
10  com.apple.SourceKitService.5.0.20191024101_osx  0x000000010796c426 SourceKit::EditorDiagConsumer::handleDiagnostic(swift::SourceManager&, swift::SourceLoc, swift::DiagnosticKind, llvm::StringRef, llvm::ArrayRef<swift::DiagnosticArgument>, swift::DiagnosticInfo const&, swift::SourceLoc) + 742
11  com.apple.SourceKitService.5.0.20191024101_osx  0x00000001086cc82d swift::DiagnosticEngine::emitDiagnostic(swift::Diagnostic const&) + 333
12  com.apple.SourceKitService.5.0.20191024101_osx  0x00000001086c9996 swift::DiagnosticEngine::flushActiveDiagnostic() + 278
13  com.apple.SourceKitService.5.0.20191024101_osx  0x00000001082f31c0 swift::IsStaticRequest::evaluate(swift::Evaluator&, swift::FuncDecl*) const + 448
14  com.apple.SourceKitService.5.0.20191024101_osx  0x0000000108377121 swift::SimpleRequest<swift::IsStaticRequest, bool (swift::FuncDecl*), (swift::CacheKind)2>::evaluateRequest(swift::IsStaticRequest const&, swift::Evaluator&) + 17
15  com.apple.SourceKitService.5.0.20191024101_osx  0x00000001086bc950 llvm::Expected<swift::IsStaticRequest::OutputType> swift::Evaluator::getResultUncached<swift::IsStaticRequest>(swift::IsStaticRequest const&) + 384
16  com.apple.SourceKitService.5.0.20191024101_osx  0x00000001086bc6f8 llvm::Expected<swift::IsStaticRequest::OutputType> swift::Evaluator::getResultCached<swift::IsStaticRequest, (void*)0>(swift::IsStaticRequest const&) + 56
17  com.apple.SourceKitService.5.0.20191024101_osx  0x00000001086bbb3b llvm::Expected<swift::IsStaticRequest::OutputType> swift::Evaluator::operator()<swift::IsStaticRequest>(swift::IsStaticRequest const&) + 107
18  com.apple.SourceKitService.5.0.20191024101_osx  0x0000000108674ef2 swift::IsStaticRequest::OutputType swift::evaluateOrDefault<swift::IsStaticRequest>(swift::Evaluator&, swift::IsStaticRequest, swift::IsStaticRequest::OutputType) + 34
19  com.apple.SourceKitService.5.0.20191024101_osx  0x0000000107b4b078 (anonymous namespace)::ModelASTWalker::walkToDeclPre(swift::Decl*) + 984
20  com.apple.SourceKitService.5.0.20191024101_osx  0x0000000108638a4a (anonymous namespace)::Traversal::doIt(swift::Decl*) + 170
21  com.apple.SourceKitService.5.0.20191024101_osx  0x000000010863dfdb (anonymous namespace)::Traversal::visitNominalTypeDecl(swift::NominalTypeDecl*) + 523
22  com.apple.SourceKitService.5.0.20191024101_osx  0x0000000108638a77 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 215
23  com.apple.SourceKitService.5.0.20191024101_osx  0x000000010863898b swift::Decl::walk(swift::ASTWalker&) + 27
24  com.apple.SourceKitService.5.0.20191024101_osx  0x000000010872fcfe swift::SourceFile::walk(swift::ASTWalker&) + 190
25  com.apple.SourceKitService.5.0.20191024101_osx  0x0000000107b48f3b swift::ide::SyntaxModelContext::walk(swift::ide::SyntaxModelWalker&) + 315
26  com.apple.SourceKitService.5.0.20191024101_osx  0x000000010796f863 SourceKit::SwiftEditorDocument::readSyntaxInfo(SourceKit::EditorConsumer&) + 1139
27  com.apple.SourceKitService.5.0.20191024101_osx  0x0000000107973746 SourceKit::SwiftLangSupport::editorReplaceText(llvm::StringRef, llvm::MemoryBuffer*, unsigned int, unsigned int, SourceKit::EditorConsumer&) + 1062
28  com.apple.SourceKitService.5.0.20191024101_osx  0x00000001079ada1e handleRequestImpl(void*, std::__1::function<void (void*)>) + 13678
29  com.apple.SourceKitService.5.0.20191024101_osx  0x00000001079aa463 sourcekitd::handleRequest(void*, std::__1::function<void (void*)>) + 275
30  com.apple.SourceKitService.5.0.20191024101_osx  0x0000000107939908 invocation function for block in sourcekitdServer_peer_event_handler(_xpc_connection_s*, void*) + 216
31  libdispatch.dylib               0x00007fff5ece65f8 _dispatch_call_block_and_release + 12
32  libdispatch.dylib               0x00007fff5ece763d _dispatch_client_callout + 8
33  libdispatch.dylib               0x00007fff5ece9a53 _dispatch_queue_override_invoke + 763
34  libdispatch.dylib               0x00007fff5ecf53bc _dispatch_root_queue_drain + 324
35  libdispatch.dylib               0x00007fff5ecf5b46 _dispatch_worker_thread2 + 90
36  libsystem_pthread.dylib         0x00007fff5ef276b3 _pthread_wqthread + 583
37  libsystem_pthread.dylib         0x00007fff5ef273fd start_wqthread + 13
@nathawes
Copy link
Collaborator Author

nathawes commented Nov 7, 2019

This seems to have been fixed somewhere between the November 1st and 6th development snapshots.

@akyrtzi
Copy link
Member

akyrtzi commented Feb 20, 2020

Works fine in swift-5.2-DEVELOPMENT-SNAPSHOT-2020-02-18-a-osx

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the compiler The Swift compiler in itself label Dec 13, 2022
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. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software found by stress tester Flag: An issue found by the SourceKit stress tester
Projects
None yet
Development

No branches or pull requests

3 participants