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-11696] USR generation crash for extension within generic struct (invalid code) #54104

Closed
nathawes opened this issue Nov 2, 2019 · 1 comment
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-11696
Radar rdar://problem/56834419
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: 5919d8967b3814efc99b975e2d671d9f

Issue Description:

Reproducer:

struct A {}
struct B<T>{
extension A {
  func foo() {}
}

Trace:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   swift                           0x00000001077c638a swift::GenericSignatureImpl::getCanonicalSignature() const + 10
1   swift                           0x00000001077c64fa swift::GenericSignatureImpl::isEqual(swift::GenericSignature) + 26
2   swift                           0x0000000107730bd0 swift::ExtensionDecl::isConstrainedExtension() const + 176
3   swift                           0x0000000107730c67 swift::ExtensionDecl::isEquivalentToExtendedContext() const + 119
4   swift                           0x00000001076d1ea1 swift::Mangle::ASTMangler::appendContext(swift::DeclContext const*) + 817
5   swift                           0x00000001076d16c0 swift::Mangle::ASTMangler::appendEntity(swift::ValueDecl const*) + 272
6   swift                           0x00000001076d6eb8 swift::Mangle::ASTMangler::mangleDeclAsUSR(swift::ValueDecl const*, llvm::StringRef) + 424
7   swift                           0x0000000107864cdd swift::USRGenerationRequest::evaluate(swift::Evaluator&, swift::ValueDecl const*) const + 1101
8   swift                           0x0000000107444d71 swift::SimpleRequest<swift::USRGenerationRequest, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > (swift::ValueDecl const*), (swift::CacheKind)1>::evaluateRequest(swift::USRGenerationRequest const&, swift::Evaluator&) + 17
9   swift                           0x00000001078670ec llvm::Expected<swift::USRGenerationRequest::OutputType> swift::Evaluator::getResultUncached<swift::USRGenerationRequest>(swift::USRGenerationRequest const&) + 380
10  swift                           0x0000000107866c1f llvm::Expected<swift::USRGenerationRequest::OutputType> swift::Evaluator::getResultCached<swift::USRGenerationRequest, (void*)0>(swift::USRGenerationRequest const&) + 239
11  swift                           0x0000000107865ffb llvm::Expected<swift::USRGenerationRequest::OutputType> swift::Evaluator::operator()<swift::USRGenerationRequest>(swift::USRGenerationRequest const&) + 107
12  swift                           0x0000000107865502 swift::USRGenerationRequest::OutputType swift::evaluateOrDefault<swift::USRGenerationRequest>(swift::Evaluator&, swift::USRGenerationRequest, swift::USRGenerationRequest::OutputType) + 34
13  swift                           0x0000000107865470 swift::ide::printValueDeclUSR(swift::ValueDecl const*, llvm::raw_ostream&) + 96
14  swift                           0x0000000106c29eda (anonymous namespace)::IndexSwiftASTWalker::getNameAndUSR(swift::ValueDecl*, swift::ExtensionDecl*, llvm::StringRef&, llvm::StringRef&) + 250
15  swift                           0x0000000106c28686 (anonymous namespace)::IndexSwiftASTWalker::walkToDeclPre(swift::Decl*, swift::CharSourceRange) + 3926
16  swift                           0x0000000106c2058f (anonymous namespace)::SemaAnnotator::walkToDeclPre(swift::Decl*) + 1423
17  swift                           0x000000010770bcba (anonymous namespace)::Traversal::doIt(swift::Decl*) + 170
18  swift                           0x000000010771124b (anonymous namespace)::Traversal::visitNominalTypeDecl(swift::NominalTypeDecl*) + 523
19  swift                           0x000000010770bce7 (anonymous namespace)::Traversal::doIt(swift::Decl*) + 215
20  swift                           0x000000010770bbfb swift::Decl::walk(swift::ASTWalker&) + 27
21  swift                           0x00000001078104ee swift::SourceFile::walk(swift::ASTWalker&) + 190
22  swift                           0x0000000106c1e76f swift::SourceEntityWalker::walk(swift::SourceFile&) + 255
23  swift                           0x0000000106c27522 (anonymous namespace)::IndexSwiftASTWalker::visitModule(swift::ModuleDecl&) + 386
24  swift                           0x0000000106c2736a swift::index::indexSourceFile(swift::SourceFile*, swift::index::IndexDataConsumer&) + 442
25  swift                           0x0000000106c2d425 recordSourceFileUnit(swift::SourceFile*, llvm::StringRef, llvm::StringRef, bool, bool, llvm::StringRef, llvm::ArrayRef<clang::FileEntry const*>, clang::CompilerInstance const&, swift::DiagnosticEngine&) + 1605
26  swift                           0x0000000106c2cd7b swift::index::indexAndRecord(swift::SourceFile*, llvm::StringRef, llvm::StringRef, bool, bool, llvm::StringRef, swift::DependencyTracker const&) + 219
27  swift                           0x00000001069b1c88 emitIndexDataIfNeeded(swift::SourceFile*, swift::CompilerInvocation const&, swift::CompilerInstance&) + 328
28  swift                           0x00000001069acde5 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 6197
29  swift                           0x00000001069aa646 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3046
30  swift                           0x000000010694fbe9 main + 729
31  libdyld.dylib                   0x00007fff5ed343d5 start + 1
@akyrtzi
Copy link
Member

akyrtzi commented Feb 20, 2020

This doesn’t seem to be an issue on latest master (0f0a908)

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added compiler The Swift compiler in itself CompilerCrash and removed compiler The Swift compiler in itself labels Sep 17, 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