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-13003] Indexing: abort() called in swift::Mangle::ASTMangler::mangleDeclAsUSR() #55448

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 crash Bug: A crash, i.e., an abnormal termination of software found by stress tester Flag: An issue found by the SourceKit stress tester mangling Area → compiler: Mangling

Comments

@nathawes
Copy link
Collaborator

Previous ID SR-13003
Radar rdar://problem/64319848
Original Reporter @nathawes
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Source Tooling
Labels Bug, Crash, FoundByStressTester
Assignee None
Priority Medium

md5: a8e8539c133830b59b0c1434e8882d97

Issue Description:

To reproduce index the below invalid code:

struct CacheBox {
  protocol CacheEntryProtocol {
    struct Foo<Cache, Key> {}
  }
}

Trace:

abort() called

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   swift                           0x000000010ff70d13 swift::Mangle::Mangler::verify(llvm::StringRef) (.cold.3) + 99
5   swift                           0x000000010c9f074c swift::Mangle::Mangler::verify(llvm::StringRef) + 796
6   swift                           0x000000010c7eea42 swift::Mangle::ASTMangler::mangleDeclAsUSR(swift::ValueDecl const*, llvm::StringRef) + 466
7   swift                           0x000000010c9e9398 swift::USRGenerationRequest::evaluate(swift::Evaluator&, swift::ValueDecl const*) const + 1080
8   swift                           0x000000010c5e8791 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
9   swift                           0x000000010c9eabd5 llvm::Expected<swift::USRGenerationRequest::OutputType> swift::Evaluator::getResultUncached<swift::USRGenerationRequest>(swift::USRGenerationRequest const&) + 581
10  swift                           0x000000010c9ea6fd llvm::Expected<swift::USRGenerationRequest::OutputType> swift::Evaluator::getResultCached<swift::USRGenerationRequest, (void*)0>(swift::USRGenerationRequest const&) + 349
11  swift                           0x000000010c9e9b44 swift::USRGenerationRequest::OutputType swift::evaluateOrDefault<swift::USRGenerationRequest>(swift::Evaluator&, swift::USRGenerationRequest, swift::USRGenerationRequest::OutputType) + 36
12  swift                           0x000000010c9e9ab0 swift::ide::printValueDeclUSR(swift::ValueDecl const*, llvm::raw_ostream&) + 96
13  swift                           0x000000010b9e128b (anonymous namespace)::IndexSwiftASTWalker::getNameAndUSR(swift::ValueDecl*, swift::ExtensionDecl*, llvm::StringRef&, llvm::StringRef&) + 299
14  swift                           0x000000010b9e090e (anonymous namespace)::IndexSwiftASTWalker::initIndexSymbol(swift::ValueDecl*, swift::SourceLoc, bool, swift::index::IndexSymbol&) + 286
15  swift                           0x000000010b9def8e (anonymous namespace)::IndexSwiftASTWalker::walkToDeclPre(swift::Decl*, swift::CharSourceRange) + 1390
16  swift                           0x000000010b9d7ec6 (anonymous namespace)::SemaAnnotator::walkToDeclPre(swift::Decl*) + 1638
17  swift                           0x000000010c82ab2a (anonymous namespace)::Traversal::doIt(swift::Decl*) + 170
18  swift                           0x000000010c82f879 (anonymous namespace)::Traversal::visitNominalTypeDecl(swift::NominalTypeDecl*) + 329
19  swift                           0x000000010c82ab57 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 215
20  swift                           0x000000010c82f879 (anonymous namespace)::Traversal::visitNominalTypeDecl(swift::NominalTypeDecl*) + 329
21  swift                           0x000000010c82ab57 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 215
22  swift                           0x000000010c82f879 (anonymous namespace)::Traversal::visitNominalTypeDecl(swift::NominalTypeDecl*) + 329
23  swift                           0x000000010c82ab57 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 215
24  swift                           0x000000010c82aa6b swift::Decl::walk(swift::ASTWalker&) + 27
25  swift                           0x000000010c964268 swift::SourceFile::walk(swift::ASTWalker&) + 216
26  swift                           0x000000010b9d5e6f swift::SourceEntityWalker::walk(swift::SourceFile&) + 255
27  swift                           0x000000010b9de766 (anonymous namespace)::IndexSwiftASTWalker::visitModule(swift::ModuleDecl&) + 230
28  swift                           0x000000010b9de64c swift::index::indexSourceFile(swift::SourceFile*, swift::index::IndexDataConsumer&) + 428
29  swift                           0x000000010b9e48f1 recordSourceFileUnit(swift::SourceFile*, llvm::StringRef, llvm::StringRef, bool, bool, bool, llvm::StringRef, llvm::ArrayRef<clang::FileEntry const*>, clang::CompilerInstance const&, swift::DiagnosticEngine&) + 1617
30  swift                           0x000000010b9e4236 swift::index::indexAndRecord(swift::SourceFile*, llvm::StringRef, llvm::StringRef, bool, bool, bool, llvm::StringRef, swift::DependencyTracker const&) + 230
31  swift                           0x000000010b8c0c4c emitIndexDataForSourceFile(swift::SourceFile*, swift::CompilerInstance const&) + 332
32  swift                           0x000000010b8c0abc performEndOfPipelineActions(swift::CompilerInstance&) + 524
33  swift                           0x000000010b8b3351 performCompile(swift::CompilerInstance&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) + 7761
34  swift                           0x000000010b8b0519 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3529
35  swift                           0x000000010b84cccd main + 861
36  libdyld.dylib                   0x00007fff6b2e5cc9 start + 1
@nathawes
Copy link
Collaborator Author

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@bnbarham
Copy link
Contributor

This looks to have been fixed at some point. It doesn't reproduce on main.

@AnthonyLatsis AnthonyLatsis added mangling Area → compiler: Mangling CompilerCrash labels Sep 17, 2022
@AnthonyLatsis AnthonyLatsis added the compiler The Swift compiler in itself label Dec 13, 2022
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 mangling Area → compiler: Mangling
Projects
None yet
Development

No branches or pull requests

3 participants