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-13004] Assertion failed: (params.empty() || ((Key.Depth == params.back()->getDepth() && Key.Index == params.back()->getIndex() + 1) || (Key.Depth > params.back()->getDepth() && Key.Index == 0))), function addGenericParameter #55449

Closed
nathawes opened this issue Jun 13, 2020 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself found by stress tester Flag: An issue found by the SourceKit stress tester

Comments

@nathawes
Copy link
Collaborator

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

md5: 214ccf4d689cfdbc548eda21f3494cc9

Issue Description:

Compile the below to reproduce:

func verifyDecoder<Decoder>() {

extension ByteToMessageDecoderVerifier {

class RecordingChannel {
  func readInbound<T>(foo bar: Int) {}

Trace:

Assertion failed: (params.empty() || ((Key.Depth == params.back()->getDepth() && Key.Index == params.back()->getIndex() + 1) || (Key.Depth > params.back()->getDepth() && Key.Index == 0))), function addGenericParameter, file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/lib/AST/GenericSignatureBuilder.cpp, line 3800.
 

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff6b42d33a __pthread_kill + 10
1   libsystem_pthread.dylib         0x00007fff6b4e9e60 pthread_kill + 430
2   libsystem_c.dylib               0x00007fff6b3b48a2 __abort + 139
3   libsystem_c.dylib               0x00007fff6b3b4817 abort + 135
4   libsystem_c.dylib               0x00007fff6b3b3ac6 __assert_rtn + 314
5   swift                           0x000000010e010883 swift::GenericSignatureBuilder::addGenericParameter(swift::GenericTypeParamType*) (.cold.4) + 35
6   swift                           0x000000010a9f77dd swift::GenericSignatureBuilder::addGenericParameter(swift::GenericTypeParamType*) + 477
7   swift                           0x000000010aa0a2ed swift::InferredGenericSignatureRequest::evaluate(swift::Evaluator&, swift::ModuleDecl*, swift::GenericSignatureImpl const*, llvm::PointerUnion<swift::GenericContext*, swift::GenericParamList*>, llvm::SmallVector<swift::Requirement, 2u>, llvm::SmallVector<swift::TypeLoc, 2u>, bool) const + 685
8   swift                           0x000000010a6bbafb swift::GenericSignature swift::SimpleRequest<swift::InferredGenericSignatureRequest, swift::GenericSignature (swift::ModuleDecl*, swift::GenericSignatureImpl const*, llvm::PointerUnion<swift::GenericContext*, swift::GenericParamList*>, llvm::SmallVector<swift::Requirement, 2u>, llvm::SmallVector<swift::TypeLoc, 2u>, bool), (swift::RequestFlags)2>::callDerived<0ul, 1ul, 2ul, 3ul, 4ul, 5ul>(swift::Evaluator&, std::__1::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul>) const + 155
9   swift                           0x000000010a66f4e9 llvm::Expected<swift::InferredGenericSignatureRequest::OutputType> swift::Evaluator::getResultUncached<swift::InferredGenericSignatureRequest>(swift::InferredGenericSignatureRequest const&) + 329
10  swift                           0x000000010a66f127 llvm::Expected<swift::InferredGenericSignatureRequest::OutputType> swift::Evaluator::getResultCached<swift::InferredGenericSignatureRequest, (void*)0>(swift::InferredGenericSignatureRequest const&) + 199
11  swift                           0x000000010a66c1e1 swift::InferredGenericSignatureRequest::OutputType swift::evaluateOrDefault<swift::InferredGenericSignatureRequest>(swift::Evaluator&, swift::InferredGenericSignatureRequest, swift::InferredGenericSignatureRequest::OutputType) + 49
12  swift                           0x000000010a66bb27 swift::TypeChecker::checkGenericSignature(llvm::PointerUnion<swift::GenericContext*, swift::GenericParamList*>, swift::DeclContext*, swift::GenericSignature, bool, llvm::SmallVector<swift::Requirement, 2u>, llvm::SmallVector<swift::TypeLoc, 2u>) + 327
13  swift                           0x000000010a66c4e4 swift::GenericSignatureRequest::evaluate(swift::Evaluator&, swift::GenericContext*) const + 516
14  swift                           0x000000010a953840 llvm::Expected<swift::GenericSignatureRequest::OutputType> swift::Evaluator::getResultUncached<swift::GenericSignatureRequest>(swift::GenericSignatureRequest const&) + 432
15  swift                           0x000000010a953553 llvm::Expected<swift::GenericSignatureRequest::OutputType> swift::Evaluator::getResultCached<swift::GenericSignatureRequest, (void*)0>(swift::GenericSignatureRequest const&) + 51
16  swift                           0x000000010a932255 swift::GenericSignatureRequest::OutputType swift::evaluateOrDefault<swift::GenericSignatureRequest>(swift::Evaluator&, swift::GenericSignatureRequest, swift::GenericSignatureRequest::OutputType) + 37
17  swift                           0x000000010a6e000b swift::TypeResolution::forInterface(swift::DeclContext*, swift::TypeResolutionOptions) + 27
18  swift                           0x000000010a636c9c swift::InterfaceTypeRequest::evaluate(swift::Evaluator&, swift::ValueDecl*) const + 1996
19  swift                           0x000000010a96a794 llvm::Expected<swift::InterfaceTypeRequest::OutputType> swift::Evaluator::getResultUncached<swift::InterfaceTypeRequest>(swift::InterfaceTypeRequest const&) + 436
20  swift                           0x000000010a96a4a3 llvm::Expected<swift::InterfaceTypeRequest::OutputType> swift::Evaluator::getResultCached<swift::InterfaceTypeRequest, (void*)0>(swift::InterfaceTypeRequest const&) + 51
21  swift                           0x000000010a939ef5 swift::InterfaceTypeRequest::OutputType swift::evaluateOrDefault<swift::InterfaceTypeRequest>(swift::Evaluator&, swift::InterfaceTypeRequest, swift::InterfaceTypeRequest::OutputType) + 37
22  swift                           0x000000010a92ecc0 swift::ValueDecl::getInterfaceType() const + 64
23  swift                           0x000000010aabc216 swift::USRGenerationRequest::evaluate(swift::Evaluator&, swift::ValueDecl const*) const + 694
24  swift                           0x000000010a6bb791 swift::SimpleRequest<swift::USRGenerationRequest, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > (swift::ValueDecl const*), (swift::RequestFlags)2>::evaluateRequest(swift::USRGenerationRequest const&, swift::Evaluator&) + 17
25  swift                           0x000000010aabdbd5 llvm::Expected<swift::USRGenerationRequest::OutputType> swift::Evaluator::getResultUncached<swift::USRGenerationRequest>(swift::USRGenerationRequest const&) + 581
26  swift                           0x000000010aabd6fd llvm::Expected<swift::USRGenerationRequest::OutputType> swift::Evaluator::getResultCached<swift::USRGenerationRequest, (void*)0>(swift::USRGenerationRequest const&) + 349
27  swift                           0x000000010aabcb44 swift::USRGenerationRequest::OutputType swift::evaluateOrDefault<swift::USRGenerationRequest>(swift::Evaluator&, swift::USRGenerationRequest, swift::USRGenerationRequest::OutputType) + 36
28  swift                           0x000000010aabcab0 swift::ide::printValueDeclUSR(swift::ValueDecl const*, llvm::raw_ostream&) + 96
29  swift                           0x0000000109ab428b (anonymous namespace)::IndexSwiftASTWalker::getNameAndUSR(swift::ValueDecl*, swift::ExtensionDecl*, llvm::StringRef&, llvm::StringRef&) + 299
30  swift                           0x0000000109ab390e (anonymous namespace)::IndexSwiftASTWalker::initIndexSymbol(swift::ValueDecl*, swift::SourceLoc, bool, swift::index::IndexSymbol&) + 286
31  swift                           0x0000000109ab1f8e (anonymous namespace)::IndexSwiftASTWalker::walkToDeclPre(swift::Decl*, swift::CharSourceRange) + 1390
32  swift                           0x0000000109aaaec6 (anonymous namespace)::SemaAnnotator::walkToDeclPre(swift::Decl*) + 1638
33  swift                           0x000000010a8fdb2a (anonymous namespace)::Traversal::doIt(swift::Decl*) + 170
34  swift                           0x000000010a902f8c (anonymous namespace)::Traversal::visitAbstractFunctionDecl(swift::AbstractFunctionDecl*) + 284
35  swift                           0x000000010a8fdb57 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 215
36  swift                           0x000000010a902879 (anonymous namespace)::Traversal::visitNominalTypeDecl(swift::NominalTypeDecl*) + 329
37  swift                           0x000000010a8fdb57 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 215
38  swift                           0x000000010a90217e swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Decl*) + 1630
39  swift                           0x000000010a8fdb57 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 215
40  swift                           0x000000010a90006c swift::ASTVisitor<(anonymous namespace)::Traversal, swift::Expr*, swift::Stmt*, bool, swift::Pattern*, bool, void>::visit(swift::Stmt*) + 460
41  swift                           0x000000010a9030b8 (anonymous namespace)::Traversal::visitAbstractFunctionDecl(swift::AbstractFunctionDecl*) + 584
42  swift                           0x000000010a8fdb57 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 215
43  swift                           0x000000010a8fda6b swift::Decl::walk(swift::ASTWalker&) + 27
44  swift                           0x000000010aa37268 swift::SourceFile::walk(swift::ASTWalker&) + 216
45  swift                           0x0000000109aa8e6f swift::SourceEntityWalker::walk(swift::SourceFile&) + 255
46  swift                           0x0000000109ab1766 (anonymous namespace)::IndexSwiftASTWalker::visitModule(swift::ModuleDecl&) + 230
47  swift                           0x0000000109ab164c swift::index::indexSourceFile(swift::SourceFile*, swift::index::IndexDataConsumer&) + 428
48  swift                           0x0000000109ab78f1 recordSourceFileUnit(swift::SourceFile*, llvm::StringRef, llvm::StringRef, bool, bool, bool, llvm::StringRef, llvm::ArrayRef<clang::FileEntry const*>, clang::CompilerInstance const&, swift::DiagnosticEngine&) + 1617
49  swift                           0x0000000109ab7236 swift::index::indexAndRecord(swift::SourceFile*, llvm::StringRef, llvm::StringRef, bool, bool, bool, llvm::StringRef, swift::DependencyTracker const&) + 230
50  swift                           0x0000000109993c4c emitIndexDataForSourceFile(swift::SourceFile*, swift::CompilerInstance const&) + 332
51  swift                           0x0000000109993abc performEndOfPipelineActions(swift::CompilerInstance&) + 524
52  swift                           0x0000000109986351 performCompile(swift::CompilerInstance&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) + 7761
53  swift                           0x0000000109983519 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3529
54  swift                           0x000000010991fccd main + 861
55  libdyld.dylib                   0x00007fff6b2e5cc9 start + 1
@nathawes
Copy link
Collaborator Author

@swift-ci create

@slavapestov
Copy link
Member

This was fixed a while ago.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 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 found by stress tester Flag: An issue found by the SourceKit stress tester
Projects
None yet
Development

No branches or pull requests

2 participants