Open llvmbot opened 10 years ago
Ok I narrowed down the issue: Clang only crashes when using precompiled headers.
I just noticed that the automatically generated pre-processed source code file is kinda useless because it is missing several headers... So I tried to manually get the pre-processed source by adding -E to the call I got from "VERBOSE=1 make". Unfortunately, when trying to compile that pre-processed file I do get regular compile errors in some 3rd party library header. I don't see an easy way to give you code to reproduce the error above =(.
Sorry, it seems that I cannot upload the file here as it is too big. Here are the links the the preprocessed source file and sh file in question:
https://boxie.eu/translator-RPgBXq.cpp https://boxie.eu/translator-RPgBXq.sh
@llvm/issue-subscribers-clang-frontend
Extended Description
Hi there,
Clang crashes for me when compiling one of my project's source files. I tested both clang 3.2 from the Debian repository as well as the latest clang 3.4 trunk (rev 192067) build. I get no errors on that file with gcc 4.8.1 and MS cl 18.0. Here is what I get from Debian's clang 3.2:
0 libLLVM-3.2.so.1 0x00002aaaaba0f67f 1 libLLVM-3.2.so.1 0x00002aaaaba0fae9 2 libpthread.so.0 0x00002aaaac407bd0 3 clang 0x0000000000f6cc3c 4 clang 0x0000000000f6cdb2 5 clang 0x0000000000f6d324 6 clang 0x0000000000f6ecf5 7 clang 0x0000000000f6d4b4 8 clang 0x0000000000f6f0cc clang::Stmt::Profile(llvm::FoldingSetNodeID&, clang::ASTContext const&, bool) const + 28 9 clang 0x0000000000e7d863 clang::ASTContext::getDecltypeType(clang::Expr, clang::QualType) const + 131 10 clang 0x0000000000696b89 clang::ASTReader::readTypeRecord(unsigned int) + 2393 11 clang 0x00000000006983ea clang::ASTReader::GetType(unsigned int) + 202 12 clang 0x00000000006987e3 clang::ASTReader::getLocalType(clang::serialization::ModuleFile&, unsigned int) + 19 13 clang 0x00000000006968a8 clang::ASTReader::readTypeRecord(unsigned int) + 1656 14 clang 0x00000000006983ea clang::ASTReader::GetType(unsigned int) + 202 15 clang 0x00000000006987e3 clang::ASTReader::getLocalType(clang::serialization::ModuleFile&, unsigned int) + 19 16 clang 0x00000000006c59fb clang::ASTDeclReader::VisitValueDecl(clang::ValueDecl) + 75 17 clang 0x00000000006c5bcf clang::ASTDeclReader::VisitDeclaratorDecl(clang::DeclaratorDecl) + 15 18 clang 0x00000000006c6fe4 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl) + 180 19 clang 0x00000000006c81a5 clang::ASTDeclReader::VisitCXXMethodDecl(clang::CXXMethodDecl) + 21 20 clang 0x00000000006cb315 clang::ASTDeclReader::Visit(clang::Decl) + 325 21 clang 0x00000000006cb93f clang::ASTReader::ReadDeclRecord(unsigned int) + 607 22 clang 0x00000000006905e7 clang::ASTReader::GetDecl(unsigned int) + 119 23 clang 0x00000000006c2fb0 clang::ASTDeclReader::VisitDecl(clang::Decl) + 96 24 clang 0x00000000006c4429 clang::ASTDeclReader::VisitNamedDecl(clang::NamedDecl) + 25 25 clang 0x00000000006c59c1 clang::ASTDeclReader::VisitValueDecl(clang::ValueDecl) + 17 26 clang 0x00000000006c5bcf clang::ASTDeclReader::VisitDeclaratorDecl(clang::DeclaratorDecl) + 15 27 clang 0x00000000006c655d clang::ASTDeclReader::VisitVarDecl(clang::VarDecl) + 157 28 clang 0x00000000006c690f clang::ASTDeclReader::VisitParmVarDecl(clang::ParmVarDecl) + 15 29 clang 0x00000000006cb2a5 clang::ASTDeclReader::Visit(clang::Decl) + 213 30 clang 0x00000000006cb93f clang::ASTReader::ReadDeclRecord(unsigned int) + 607 31 clang 0x00000000006905e7 clang::ASTReader::GetDecl(unsigned int) + 119 32 clang 0x00000000006ddd4b clang::ASTStmtReader::VisitDeclRefExpr(clang::DeclRefExpr) + 363 33 clang 0x00000000006de4c8 clang::ASTReader::ReadStmtFromStream(clang::serialization::ModuleFile&) + 1176 34 clang 0x0000000000696b7a clang::ASTReader::readTypeRecord(unsigned int) + 2378 35 clang 0x00000000006983ea clang::ASTReader::GetType(unsigned int) + 202 36 clang 0x00000000006987e3 clang::ASTReader::getLocalType(clang::serialization::ModuleFile&, unsigned int) + 19 37 clang 0x000000000069ba8a clang::ASTReader::ReadTemplateArgument(clang::serialization::ModuleFile&, llvm::SmallVector<unsigned long, 64u> const&, unsigned int&) + 490 38 clang 0x0000000000696205 clang::ASTReader::ReadTemplateArgumentList(llvm::SmallVector<clang::TemplateArgument, 8u>&, clang::serialization::ModuleFile&, llvm::SmallVector<unsigned long, 64u> const&, unsigned int&) + 181 39 clang 0x0000000000697769 clang::ASTReader::readTypeRecord(unsigned int) + 5433 40 clang 0x00000000006983ea clang::ASTReader::GetType(unsigned int) + 202 41 clang 0x00000000006987e3 clang::ASTReader::getLocalType(clang::serialization::ModuleFile&, unsigned int) + 19 42 clang 0x0000000000697b45 clang::ASTReader::readTypeRecord(unsigned int) + 6421 43 clang 0x00000000006983ea clang::ASTReader::GetType(unsigned int) + 202 44 clang 0x00000000006987e3 clang::ASTReader::getLocalType(clang::serialization::ModuleFile&, unsigned int) + 19 45 clang 0x0000000000698984 clang::ASTReader::ReadNestedNameSpecifier(clang::serialization::ModuleFile&, llvm::SmallVector<unsigned long, 64u> const&, unsigned int&) + 404 46 clang 0x00000000006970b2 clang::ASTReader::readTypeRecord(unsigned int) + 3714 47 clang 0x00000000006983ea clang::ASTReader::GetType(unsigned int) + 202 48 clang 0x00000000006987e3 clang::ASTReader::getLocalType(clang::serialization::ModuleFile&, unsigned int) + 19 49 clang 0x00000000006968a8 clang::ASTReader::readTypeRecord(unsigned int) + 1656 50 clang 0x00000000006983ea clang::ASTReader::GetType(unsigned int) + 202 51 clang 0x00000000006987e3 clang::ASTReader::getLocalType(clang::serialization::ModuleFile&, unsigned int) + 19 52 clang 0x00000000006c59fb clang::ASTDeclReader::VisitValueDecl(clang::ValueDecl) + 75 53 clang 0x00000000006c5bcf clang::ASTDeclReader::VisitDeclaratorDecl(clang::DeclaratorDecl) + 15 54 clang 0x00000000006c6fe4 clang::ASTDeclReader::VisitFunctionDecl(clang::FunctionDecl) + 180 55 clang 0x00000000006c81a5 clang::ASTDeclReader::VisitCXXMethodDecl(clang::CXXMethodDecl) + 21 56 clang 0x00000000006cb315 clang::ASTDeclReader::Visit(clang::Decl) + 325 57 clang 0x00000000006cb93f clang::ASTReader::ReadDeclRecord(unsigned int) + 607 58 clang 0x00000000006905e7 clang::ASTReader::GetDecl(unsigned int) + 119 59 clang 0x00000000006c448f clang::ASTDeclReader::VisitTemplateDecl(clang::TemplateDecl) + 63 60 clang 0x00000000006c8c60 clang::ASTDeclReader::VisitRedeclarableTemplateDecl(clang::RedeclarableTemplateDecl) + 224 61 clang 0x00000000006c8e29 clang::ASTDeclReader::VisitFunctionTemplateDecl(clang::FunctionTemplateDecl) + 25 62 clang 0x00000000006cb445 clang::ASTDeclReader::Visit(clang::Decl) + 629 63 clang 0x00000000006cb93f clang::ASTReader::ReadDeclRecord(unsigned int) + 607 64 clang 0x00000000006905e7 clang::ASTReader::GetDecl(unsigned int) + 119 65 clang 0x0000000000690944 66 clang 0x00000000007209ac clang::serialization::ModuleManager::visitDepthFirst(bool ()(clang::serialization::ModuleFile&, bool, void), void) + 188 67 clang 0x000000000068648a clang::ASTReader::FindExternalLexicalDecls(clang::DeclContext const, bool ()(clang::Decl::Kind), llvm::SmallVectorImpl<clang::Decl>&) + 74 68 clang 0x0000000000ed9101 clang::DeclContext::LoadLexicalDeclsFromExternalStorage() const + 113 69 clang 0x0000000000ed921f clang::DeclContext::decls_begin() const + 15 70 clang 0x0000000000b2fc25 clang::Sema::InstantiateClass(clang::SourceLocation, clang::CXXRecordDecl, clang::CXXRecordDecl, clang::MultiLevelTemplateArgumentList const&, clang::TemplateSpecializationKind, bool) + 917 71 clang 0x0000000000b31395 clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation, clang::ClassTemplateSpecializationDecl, clang::TemplateSpecializationKind, bool) + 1237 72 clang 0x0000000000b5f565 clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType, clang::Sema::TypeDiagnoser&) + 1189 73 clang 0x0000000000a23e89 clang::Sema::BuildCXXTypeConstructExpr(clang::TypeSourceInfo, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr>, clang::SourceLocation) + 489 74 clang 0x0000000000b25f58 75 clang 0x0000000000b3b72b 76 clang 0x0000000000b26020 77 clang 0x0000000000b38c45 78 clang 0x0000000000b39466 79 clang 0x0000000000b38092 80 clang 0x0000000000b37cf4 81 clang 0x0000000000b39466 82 clang 0x0000000000b38092 83 clang 0x0000000000b39def clang::Sema::SubstStmt(clang::Stmt, clang::MultiLevelTemplateArgumentList const&) + 79 84 clang 0x0000000000b4d93a clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl, bool, bool) + 1082 85 clang 0x0000000000b4cd2e clang::Sema::PerformPendingInstantiations(bool) + 494 86 clang 0x0000000000b4dcea clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl, bool, bool) + 2026 87 clang 0x0000000000b4cd2e clang::Sema::PerformPendingInstantiations(bool) + 494 88 clang 0x0000000000b4dcea clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl, bool, bool) + 2026 89 clang 0x0000000000b4cd2e clang::Sema::PerformPendingInstantiations(bool) + 494 90 clang 0x0000000000b4dcea clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl, bool, bool) + 2026 91 clang 0x0000000000b4cd2e clang::Sema::PerformPendingInstantiations(bool) + 494 92 clang 0x0000000000b4dcea clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl, bool, bool) + 2026 93 clang 0x0000000000b4cd2e clang::Sema::PerformPendingInstantiations(bool) + 494 94 clang 0x0000000000b4dcea clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl, bool, bool) + 2026 95 clang 0x0000000000b4cd2e clang::Sema::PerformPendingInstantiations(bool) + 494 96 clang 0x0000000000b4dcea clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl, bool, bool) + 2026 97 clang 0x0000000000b4cd2e clang::Sema::PerformPendingInstantiations(bool) + 494 98 clang 0x0000000000b4dcea clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl, bool, bool) + 2026 99 clang 0x0000000000b4cd2e clang::Sema::PerformPendingInstantiations(bool) + 494 100 clang 0x0000000000b4dcea clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl, bool, bool) + 2026 101 clang 0x0000000000b4cd2e clang::Sema::PerformPendingInstantiations(bool) + 494 102 clang 0x0000000000b4dcea clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl, bool, bool) + 2026 103 clang 0x0000000000b4cd2e clang::Sema::PerformPendingInstantiations(bool) + 494 104 clang 0x0000000000b4dcea clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl, bool, bool) + 2026 105 clang 0x0000000000b4cd2e clang::Sema::PerformPendingInstantiations(bool) + 494 106 clang 0x0000000000b4dcea clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl, bool, bool) + 2026 107 clang 0x0000000000b4cd2e clang::Sema::PerformPendingInstantiations(bool) + 494 108 clang 0x0000000000b4dcea clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl, bool, bool) + 2026 109 clang 0x0000000000b4cd2e clang::Sema::PerformPendingInstantiations(bool) + 494 110 clang 0x0000000000b4dcea clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl, bool, bool) + 2026 111 clang 0x0000000000b4cd2e clang::Sema::PerformPendingInstantiations(bool) + 494 112 clang 0x0000000000b4dcea clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl, bool, bool) + 2026 113 clang 0x0000000000b4cd2e clang::Sema::PerformPendingInstantiations(bool) + 494 114 clang 0x0000000000b4dcea clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl, bool, bool) + 2026 115 clang 0x0000000000b4cd2e clang::Sema::PerformPendingInstantiations(bool) + 494 116 clang 0x0000000000b4dcea clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl, bool, bool) + 2026 117 clang 0x0000000000b4cd2e clang::Sema::PerformPendingInstantiations(bool) + 494 118 clang 0x0000000000b4dcea clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl, bool, bool) + 2026 119 clang 0x0000000000b4cd2e clang::Sema::PerformPendingInstantiations(bool) + 494 120 clang 0x00000000008e1903 clang::Sema::ActOnEndOfTranslationUnit() + 2323 121 clang 0x0000000000861613 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr&) + 387
122 clang 0x0000000000859afb clang::ParseAST(clang::Sema&, bool, bool) + 267
123 clang 0x00000000005f50b1 clang::FrontendAction::Execute() + 97
124 clang 0x00000000005dc57a clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 282
125 clang 0x00000000005c5e92 clang::ExecuteCompilerInvocation(clang::CompilerInstance ) + 1378
126 clang 0x00000000005c0e88 cc1_main(char const, char const, char const, void) + 1160
127 clang 0x00000000005bfd84 main + 7316
128 libc.so.6 0x00002aaaacb50ea5 __libc_start_main + 245
129 clang 0x00000000005c0889
Stack dump:
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang: note: diagnostic msg: /tmp/translator-RPgBXq.cpp clang: note: diagnostic msg: /tmp/translator-RPgBXq.sh clang: note: diagnostic msg:
make[2]: [source/protogen/CMakeFiles/shift.protogen.dir/translator.cpp.o] Error 254 make[1]: [source/protogen/CMakeFiles/shift.protogen.dir/all] Error 2 make: *** [all] Error 2