Uploaded image for project: 'Swift'
  1. Swift
  2. SR-13003

Indexing: abort() called in swift::Mangle::ASTMangler::mangleDeclAsUSR()

    XMLWordPrintable

    Details

      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
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            nathawes Nathan Hawes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: