https://llvm.org/bugs/show_bug.cgi?id=25990
Bug ID: 25990 Summary: Segfault when compiling Product: clang Version: 3.7 Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: -New Bugs Assignee: unassignedclangb...@nondot.org Reporter: widlundtob...@gmail.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Sudden segfault when compiling a previously working codebase, half way into adding a PIMPL style wrapper, making some object types undeclared. Below is the crash backtrace and run script: backtrace: [ 1%] Building CXX object CMakeFiles/darkest_matter.dir/src/gamesession.cpp.o In file included from /home/tobbe/projects/darkestmatter/src/gamesession.cpp:1: /home/tobbe/projects/darkestmatter/src/gamesession.hpp:19:9: error: unknown type name 'Pimpl' Pimpl<RenderingSystem> mRenderingSystem; ^ /home/tobbe/projects/darkestmatter/src/gamesession.hpp:19:14: error: expected member name or ';' after declaration specifiers Pimpl<RenderingSystem> mRenderingSystem; ~~~~~^ /home/tobbe/projects/darkestmatter/src/gamesession.cpp:17:5: error: member initializer 'mRenderingSystem' does not name a non-static data member or base class mRenderingSystem(fea::Viewport({1024, 768}, {0, 0}, fea::Camera({1024 / 2.0f, 768 / 2.0f})), bus, Tiles::cTileSize) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/tobbe/projects/darkestmatter/src/gamesession.cpp:25:9: error: use of undeclared identifier 'mRenderingSystem' mRenderingSystem.addTexture(id, makeTexture(texturePath)); ^ /home/tobbe/projects/darkestmatter/src/gamesession.cpp:34:9: error: use of undeclared identifier 'mRenderingSystem' mRenderingSystem.addConstructionSpriteType(id, ^ /home/tobbe/projects/darkestmatter/src/gamesession.cpp:48:9: error: use of undeclared identifier 'mRenderingSystem' mRenderingSystem.addWallType(id, mResources.textureIds().at(wall.texture), wall.textureCoordinates); ^ /home/tobbe/projects/darkestmatter/src/gamesession.cpp:53:9: error: use of undeclared identifier 'mRenderingSystem' mRenderingSystem.addConstructionType({ConstructionCategory::WALL, id}, constructionGraphicsId); ^ /home/tobbe/projects/darkestmatter/src/gamesession.cpp:62:9: error: use of undeclared identifier 'mRenderingSystem' mRenderingSystem.addWallOreType(id, {wallOre.lowAmount, wallOre.midAmount, wallOre.higAmount}, mResources.textureIds().at(wallOre.texture), wallOre.textureCoordinates); ^ /home/tobbe/projects/darkestmatter/src/gamesession.cpp:70:9: error: use of undeclared identifier 'mRenderingSystem' mRenderingSystem.addGroundType(id, mResources.textureIds().at(ground.texture), ground.textureCoordinates); ^ /home/tobbe/projects/darkestmatter/src/gamesession.cpp:82:9: error: use of undeclared identifier 'mRenderingSystem' mRenderingSystem.addFloorType(id, mResources.textureIds().at(floor.texture), floor.textureCoordinates); ^ /home/tobbe/projects/darkestmatter/src/gamesession.cpp:83:9: error: use of undeclared identifier 'mRenderingSystem' mRenderingSystem.addConstructionType({ConstructionCategory::FLOOR, id}, constructionGraphicsId); ^ /home/tobbe/projects/darkestmatter/src/gamesession.cpp:92:9: error: use of undeclared identifier 'mRenderingSystem' mRenderingSystem.addItemType(id, ^ /home/tobbe/projects/darkestmatter/src/gamesession.cpp:129:9: error: use of undeclared identifier 'mRenderingSystem' mRenderingSystem.addAnimatedSpriteType(id, ^ /home/tobbe/projects/darkestmatter/src/gamesession.cpp:287:16: error: use of undeclared identifier 'mRenderingSystem' return mRenderingSystem.renderer().getViewport().untransformPoint(screenCoords); ^ /home/tobbe/projects/darkestmatter/src/gamesession.cpp:328:5: error: use of undeclared identifier 'mRenderingSystem' mRenderingSystem.render(); ^ 0 libLLVM.so.3.7 0x00007f2b60a67228 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 56 1 libLLVM.so.3.7 0x00007f2b60a66041 2 libpthread.so.0 0x00007f2b602f8d60 3 libc.so.6 0x00007f2b5fa27b6e realloc + 62 4 libLLVM.so.3.7 0x00007f2b60a1dee7 llvm::SmallVectorBase::grow_pod(void*, unsigned long, unsigned long) + 55 5 libLLVM.so.3.7 0x00007f2b60a113b8 llvm::FoldingSetNodeID::AddInteger(unsigned int) + 56 6 clang-3.7 0x000000000064cf2a 7 clang-3.7 0x000000000141b253 clang::Stmt::Profile(llvm::FoldingSetNodeID&, clang::ASTContext const&, bool) const + 4099 8 clang-3.7 0x00000000012b766b clang::ASTContext::getDecltypeType(clang::Expr*, clang::QualType) const + 107 9 clang-3.7 0x0000000000fe23ab clang::Sema::BuildDecltypeType(clang::Expr*, clang::SourceLocation, bool) + 155 10 clang-3.7 0x0000000000fa01a4 11 clang-3.7 0x0000000000fa0cb1 12 clang-3.7 0x0000000000fa0e68 13 clang-3.7 0x0000000000fa0fd3 clang::Sema::SubstType(clang::QualType, clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation, clang::DeclarationName) + 99 14 clang-3.7 0x0000000000f411d7 clang::Sema::CheckTemplateIdType(clang::TemplateName, clang::SourceLocation, clang::TemplateArgumentListInfo&) + 1527 15 clang-3.7 0x0000000000fb13d6 16 clang-3.7 0x0000000000f9fe58 17 clang-3.7 0x0000000000fa0cb1 18 clang-3.7 0x0000000000fae255 19 clang-3.7 0x0000000000fb1557 20 clang-3.7 0x0000000000f9fe58 21 clang-3.7 0x0000000000fa0cb1 22 clang-3.7 0x0000000000fae255 23 clang-3.7 0x0000000000fb1557 24 clang-3.7 0x0000000000f9fe58 25 clang-3.7 0x0000000000fa0cb1 26 clang-3.7 0x0000000000fa0e68 27 clang-3.7 0x0000000000fa0fd3 clang::Sema::SubstType(clang::QualType, clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation, clang::DeclarationName) + 99 28 clang-3.7 0x0000000000f411d7 clang::Sema::CheckTemplateIdType(clang::TemplateName, clang::SourceLocation, clang::TemplateArgumentListInfo&) + 1527 29 clang-3.7 0x0000000000fb13d6 30 clang-3.7 0x0000000000f9fe58 31 clang-3.7 0x0000000000fa0cb1 32 clang-3.7 0x0000000000fae255 33 clang-3.7 0x0000000000fb1557 34 clang-3.7 0x0000000000f9fe58 35 clang-3.7 0x0000000000fa0cb1 36 clang-3.7 0x0000000000fa0e13 clang::Sema::SubstType(clang::TypeSourceInfo*, clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation, clang::DeclarationName) + 131 37 clang-3.7 0x0000000000f2fbca 38 clang-3.7 0x0000000000f3517f clang::Sema::SubstDefaultTemplateArgumentIfAvailable(clang::TemplateDecl*, clang::SourceLocation, clang::SourceLocation, clang::Decl*, llvm::SmallVectorImpl<clang::TemplateArgument>&, bool&) + 303 39 clang-3.7 0x0000000000f8e1a9 clang::Sema::FinishTemplateArgumentDeduction(clang::FunctionTemplateDecl*, llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, unsigned int, clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, llvm::SmallVectorImpl<clang::Sema::OriginalCallArg> const*, bool) + 2073 40 clang-3.7 0x0000000000f981c2 clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*, clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>, clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, bool) + 1554 41 clang-3.7 0x0000000000ee8ff4 clang::Sema::AddTemplateOverloadCandidate(clang::FunctionTemplateDecl*, clang::DeclAccessPair, clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool, bool) + 452 42 clang-3.7 0x0000000000eeaaa1 43 clang-3.7 0x0000000000eeb511 44 clang-3.7 0x0000000000eec75f 45 clang-3.7 0x0000000000ee7b64 46 clang-3.7 0x0000000000ee8ce8 clang::Sema::AddOverloadCandidate(clang::FunctionDecl*, clang::DeclAccessPair, llvm::ArrayRef<clang::Expr*>, clang::OverloadCandidateSet&, bool, bool, bool) + 1576 47 clang-3.7 0x0000000000e4ca51 48 clang-3.7 0x0000000000e56984 1 #pragma once 49 clang-3.7 0x0000000000e5fd1a clang::InitializationSequence::InitializeFrom(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, bool) + 2042 50 clang-3.7 0x0000000000dfe9b4 clang::Sema::BuildCXXNew(clang::SourceRange, bool, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::SourceRange, clang::QualType, clang::TypeSourceInfo*, clang::Expr*, clang::SourceRange, clang::Expr*, bool) + 4372 51 clang-3.7 0x0000000000facd44 52 clang-3.7 0x0000000000fa58cb 53 clang-3.7 0x0000000000fa6a18 54 clang-3.7 0x0000000000fa65b3 55 clang-3.7 0x0000000000fa7d8f 56 clang-3.7 0x0000000000fa5882 57 clang-3.7 0x0000000000fa6a18 58 clang-3.7 0x0000000000fa6ad1 59 clang-3.7 0x0000000000fb44b5 60 clang-3.7 0x0000000000fb56fb 61 clang-3.7 0x0000000000fb583b 62 clang-3.7 0x0000000000fb4755 63 clang-3.7 0x0000000000fb7f8f clang::Sema::SubstStmt(clang::Stmt*, clang::MultiLevelTemplateArgumentList const&) + 95 64 clang-3.7 0x0000000000fcc2e1 clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation, clang::FunctionDecl*, bool, bool) + 3745 65 clang-3.7 0x0000000000fcc5fa clang::Sema::PerformPendingInstantiations(bool) + 314 66 clang-3.7 0x0000000000c423e5 clang::Sema::ActOnEndOfTranslationUnit() + 341 67 clang-3.7 0x0000000000ac2a09 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 601 68 clang-3.7 0x0000000000ab6fa3 clang::ParseAST(clang::Sema&, bool, bool) + 499 69 clang-3.7 0x0000000000908b06 clang::FrontendAction::Execute() + 502 70 clang-3.7 0x00000000008e2e79 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 313 71 clang-3.7 0x0000000000982624 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1940 72 clang-3.7 0x0000000000652958 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 2280 73 clang-3.7 0x000000000064db7b main + 1003 74 libc.so.6 0x00007f2b5f9cc610 __libc_start_main + 240 75 clang-3.7 0x0000000000650839 _start + 41 Stack dump: 0. Program arguments: /usr/bin/clang-3.7 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -disable-llvm-verifier -main-file-name gamesession.cpp -mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -momit-leaf-frame-pointer -g -dwarf-column-info -coverage-file /home/tobbe/projects/darkestmatter/CMakeFiles/darkest_matter.dir/src/gamesession.cpp.o -resource-dir /usr/bin/../lib/clang/3.7.0 -I /usr/include/AL -I /usr/local/include -I /home/tobbe/projects/darkestmatter/src -internal-isystem /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0 -internal-isystem /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0/x86_64-unknown-linux-gnu -internal-isystem /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0/backward -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/clang/3.7.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wall -Wextra -Wshadow -Wconversion -Wno-long-long -Wno-unused-parameter -pedantic -std=c++14 -fdeprecated-macro -fdebug-compilation-dir /home/tobbe/projects/darkestmatter -ferror-limit 19 -fmessage-length 239 -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o CMakeFiles/darkest_matter.dir/src/gamesession.cpp.o -x c++ /home/tobbe/projects/darkestmatter/src/gamesession.cpp 1. <eof> parser at end of file 2. /usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0/bits/unique_ptr.h:764:5: instantiating function definition 'make_unique' clang-3.7: error: unable to execute command: Segmentation fault (core dumped) clang-3.7: error: clang frontend command failed due to signal (use -v to see invocation) clang version 3.7.0 (tags/RELEASE_370/final) Target: x86_64-unknown-linux-gnu Thread model: posix clang-3.7: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script. clang-3.7: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang-3.7: note: diagnostic msg: /tmp/gamesession-d9b25a.cpp clang-3.7: note: diagnostic msg: /tmp/gamesession-d9b25a.sh clang-3.7: note: diagnostic msg: ******************** CMakeFiles/darkest_matter.dir/build.make:62: recipe for target 'CMakeFiles/darkest_matter.dir/src/gamesession.cpp.o' failed make[2]: *** [CMakeFiles/darkest_matter.dir/src/gamesession.cpp.o] Error 254 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/darkest_matter.dir/all' failed make[1]: *** [CMakeFiles/darkest_matter.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2 run script: # Crash reproducer for clang version 3.7.0 (tags/RELEASE_370/final) # Driver args: "--driver-mode=g++" "-I" "/usr/include/AL" "-I" "/usr/local/include" "-I" "/home/tobbe/projects/darkestmatter/src" "-std=c++14" "-Wall" "-Wextra" "-Wshadow" "-Wconversion" "-Wno-long-long" "-pedantic" "-Wno-unused-parameter" "-O2" "-g" "-o" "CMakeFiles/darkest_matter.dir/src/gamesession.cpp.o" "-c" "/home/tobbe/projects/darkestmatter/src/gamesession.cpp" # Original command: "/usr/bin/clang-3.7" "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "-disable-free" "-disable-llvm-verifier" "-main-file-name" "gamesession.cpp" "-mrelocation-model" "static" "-mthread-model" "posix" "-fmath-errno" "-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-fuse-init-array" "-target-cpu" "x86-64" "-momit-leaf-frame-pointer" "-g" "-dwarf-column-info" "-coverage-file" "/home/tobbe/projects/darkestmatter/CMakeFiles/darkest_matter.dir/src/gamesession.cpp.o" "-resource-dir" "/usr/bin/../lib/clang/3.7.0" "-I" "/usr/include/AL" "-I" "/usr/local/include" "-I" "/home/tobbe/projects/darkestmatter/src" "-internal-isystem" "/usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0" "-internal-isystem" "/usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0/x86_64-unknown-linux-gnu" "-internal-isystem" "/usr/bin/../lib64/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0/backward" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/usr/bin/../lib/clang/3.7.0/include" "-internal-externc-isystem" "/include" "-internal-externc-isystem" "/usr/include" "-O2" "-Wall" "-Wextra" "-Wshadow" "-Wconversion" "-Wno-long-long" "-Wno-unused-parameter" "-pedantic" "-std=c++14" "-fdeprecated-macro" "-fdebug-compilation-dir" "/home/tobbe/projects/darkestmatter" "-ferror-limit" "19" "-fmessage-length" "239" "-mstackrealign" "-fobjc-runtime=gcc" "-fcxx-exceptions" "-fexceptions" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-vectorize-loops" "-vectorize-slp" "-o" "CMakeFiles/darkest_matter.dir/src/gamesession.cpp.o" "-x" "c++" "/home/tobbe/projects/darkestmatter/src/gamesession.cpp" "/usr/bin/clang-3.7" "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "-disable-free" "-disable-llvm-verifier" "-main-file-name" "gamesession.cpp" "-mrelocation-model" "static" "-mthread-model" "posix" "-fmath-errno" "-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-fuse-init-array" "-target-cpu" "x86-64" "-momit-leaf-frame-pointer" "-g" "-dwarf-column-info" "-O2" "-Wall" "-Wextra" "-Wshadow" "-Wconversion" "-Wno-long-long" "-Wno-unused-parameter" "-pedantic" "-std=c++14" "-fdeprecated-macro" "-ferror-limit" "19" "-fmessage-length" "239" "-mstackrealign" "-fobjc-runtime=gcc" "-fcxx-exceptions" "-fexceptions" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-vectorize-loops" "-vectorize-slp" "-x" "c++" "gamesession-d9b25a.cpp" -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs