Working on a CL to remove an unused Pepper API, I had removed a header but not yet updated .cc files to remove the #include - when I ran the build I got:
clang++: /b/swarming/w/ir/kitchen-workdir/src/third_party/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp:118: clang::ParsedType clang::Sema::getConstructorName(clang::IdentifierInfo &, clang::SourceLocation, clang::Scope *, clang::CXXScopeSpec &, bool): Assertion `InjectedClassName && "couldn't find injected class name"' failed.
Stack dump:
0. Program arguments: ../../third_party/llvm-build/Release+Asserts/bin/clang++ -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name ppb_flash_device_id_thunk.cc -mrelocation-model pic -pic-level 2 -mthread-model posix -fmerge-all-constants -mdisable-fp-elim -relaxed-aliasing -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -enable-split-dwarf -debug-info-kind=limited -debugger-tuning=gdb -ggnu-pubnames -split-dwarf-file obj/ppapi/thunk/thunk/ppb_flash_device_id_thunk.dwo -coverage-notes-file /usr/local/google/home/wez/Projects/git-chrome/src/out/gnDebug/obj/ppapi/thunk/thunk/ppb_flash_device_id_thunk.gcno -nostdinc++ -resource-dir ../../third_party/llvm-build/Release+Asserts/lib/clang/7.0.0 -dependency-file obj/ppapi/thunk/thunk/ppb_flash_device_id_thunk.o.d -MT obj/ppapi/thunk/thunk/ppb_flash_device_id_thunk.o -isystem ../../build/linux/debian_sid_amd64-sysroot/usr/include/glib-2.0 -isystem ../../build/linux/debian_sid_amd64-sysroot/usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem ../../buildtools/third_party/libc++/trunk/include -isystem ../../buildtools/third_party/libc++abi/trunk/include -D PPAPI_SHARED_IMPLEMENTATION -D PPAPI_THUNK_IMPLEMENTATION -D V8_DEPRECATION_WARNINGS -D USE_UDEV -D USE_AURA=1 -D USE_GLIB=1 -D USE_NSS_CERTS=1 -D USE_X11=1 -D FULL_SAFE_BROWSING -D SAFE_BROWSING_CSD -D SAFE_BROWSING_DB_LOCAL -D CHROMIUM_BUILD -D FIELDTRIAL_TESTING_ENABLED -D _FILE_OFFSET_BITS=64 -D _LARGEFILE_SOURCE -D _LARGEFILE64_SOURCE -D CR_CLANG_REVISION="338452-1" -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D COMPONENT_BUILD -D CR_LIBCXX_REVISION=332543 -D CR_LIBCXXABI_REVISION=331450 -D CR_SYSROOT_HASH=4e7db513b0faeea8fb410f70c9909e8736f5c0ab -D _DEBUG -D DYNAMIC_ANNOTATIONS_ENABLED=1 -D WTF_USE_DYNAMIC_ANNOTATIONS=1 -D _GLIBCXX_DEBUG=1 -D GLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32 -D GLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26 -I ../.. -I gen -D __DATE__= -D __TIME__= -D __TIMESTAMP__= -isysroot ../../build/linux/debian_sid_amd64-sysroot -internal-isystem ../../build/linux/debian_sid_amd64-sysroot/usr/local/include -internal-isystem ../../third_party/llvm-build/Release+Asserts/lib/clang/7.0.0/include -internal-externc-isystem ../../build/linux/debian_sid_amd64-sysroot/usr/include/x86_64-linux-gnu -internal-externc-isystem ../../build/linux/debian_sid_amd64-sysroot/include -internal-externc-isystem ../../build/linux/debian_sid_amd64-sysroot/usr/include -O0 -Wno-builtin-macro-redefined -Wall -Werror -Wextra -Wimplicit-fallthrough -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-unneeded-internal-declaration -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-user-defined-warnings -Wno-unused-lambda-capture -Wno-null-pointer-arithmetic -Wno-enum-compare-switch -Wno-ignored-pragma-optimize -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=gnu++14 -fdeprecated-macro -fdebug-compilation-dir /usr/local/google/home/wez/Projects/git-chrome/src/out/gnDebug -ferror-limit 19 -fmessage-length 0 -fvisibility hidden -fvisibility-inlines-hidden -pthread -stack-protector 1 -stack-protector-buffer-size 4 -fno-rtti -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -mllvm -instcombine-lower-dbg-declare=0 -fdebug-compilation-dir . -load ../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -add-plugin find-bad-constructs -plugin-arg-find-bad-constructs enforce-in-thirdparty-webkit -plugin-arg-find-bad-constructs check-enum-max-value -plugin-arg-find-bad-constructs check-ipc -o obj/ppapi/thunk/thunk/ppb_flash_device_id_thunk.o -x c++ ../../ppapi/thunk/ppb_flash_device_id_thunk.cc -fcomplete-member-pointers -faddrsig
1. ../../buildtools/third_party/libc++/trunk/include/map:1303:42: current parser token '('
2. ../../buildtools/third_party/libc++/trunk/include/map:454:1 <Spelling=../../buildtools/third_party/libc++/trunk/include/__config:458:37>: parsing namespace 'std'
3. ../../buildtools/third_party/libc++/trunk/include/map:454:1 <Spelling=../../buildtools/third_party/libc++/trunk/include/__config:458:59>: parsing namespace 'std::__1'
#0 0x000000000209fbc4 (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x209fbc4)
#1 0x000000000209da6e llvm::sys::RunSignalHandlers() (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x209da6e)
#2 0x000000000209fd82 (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x209fd82)
#3 0x00007f3d4a2bb0c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x110c0)
#4 0x00007f3d49076fcf gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x32fcf)
#5 0x00007f3d490783fa abort (/lib/x86_64-linux-gnu/libc.so.6+0x343fa)
#6 0x00007f3d4906fe37 (/lib/x86_64-linux-gnu/libc.so.6+0x2be37)
#7 0x00007f3d4906fee2 (/lib/x86_64-linux-gnu/libc.so.6+0x2bee2)
#8 0x000000000389e714 clang::Sema::getConstructorName(clang::IdentifierInfo&, clang::SourceLocation, clang::Scope*, clang::CXXScopeSpec&, bool) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x389e714)
#9 0x000000000331fc24 clang::Parser::ParseUnqualifiedId(clang::CXXScopeSpec&, bool, bool, bool, bool, clang::OpaquePtr<clang::QualType>, clang::SourceLocation*, clang::UnqualifiedId&) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x331fc24)
#10 0x00000000032ecaf6 clang::Parser::ParseDirectDeclarator(clang::Declarator&) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x32ecaf6)
#11 0x00000000032ebdb1 clang::Parser::ParseDeclaratorInternal(clang::Declarator&, void (clang::Parser::*)(clang::Declarator&)) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x32ebdb1)
#12 0x00000000033685d4 clang::Parser::ParseSingleDeclarationAfterTemplate(clang::DeclaratorContext, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x33685d4)
#13 0x0000000003367d1e clang::Parser::ParseTemplateDeclarationOrSpecialization(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x3367d1e)
#14 0x00000000033676e6 clang::Parser::ParseDeclarationStartingWithTemplate(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x33676e6)
#15 0x00000000032dcf2f clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x32dcf2f)
#16 0x00000000032c448a clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x32c448a)
#17 0x00000000032f6ca6 clang::Parser::ParseInnerNamespace(std::vector<clang::SourceLocation, std::allocator<clang::SourceLocation> >&, std::vector<clang::IdentifierInfo*, std::allocator<clang::IdentifierInfo*> >&, std::vector<clang::SourceLocation, std::allocator<clang::SourceLocation> >&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x32f6ca6)
#18 0x00000000032f64a2 clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x32f64a2)
#19 0x00000000032dcf9b clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x32dcf9b)
#20 0x00000000032c448a clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x32c448a)
#21 0x00000000032f6ca6 clang::Parser::ParseInnerNamespace(std::vector<clang::SourceLocation, std::allocator<clang::SourceLocation> >&, std::vector<clang::IdentifierInfo*, std::allocator<clang::IdentifierInfo*> >&, std::vector<clang::SourceLocation, std::allocator<clang::SourceLocation> >&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x32f6ca6)
#22 0x00000000032f64a2 clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x32f64a2)
#23 0x00000000032dcf9b clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x32dcf9b)
#24 0x00000000032c448a clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x32c448a)
#25 0x00000000032c3afb clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x32c3afb)
#26 0x00000000032be8c7 clang::ParseAST(clang::Sema&, bool, bool) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x32be8c7)
#27 0x0000000002732fb0 clang::FrontendAction::Execute() (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x2732fb0)
#28 0x00000000026db741 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x26db741)
#29 0x00000000027d6669 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x27d6669)
#30 0x00000000008ca7e3 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x8ca7e3)
#31 0x00000000008c7fe5 main (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x8c7fe5)
#32 0x00007f3d490642b1 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b1)
#33 0x00000000008c4f8d _start (../../third_party/llvm-build/Release+Asserts/bin/clang+++0x8c4f8d)
clang++: error: unable to execute command: Aborted
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 7.0.0 (trunk 338452)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: ../../third_party/llvm-build/Release+Asserts/bin
clang++: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
clang++: note: diagnostic msg: Error generating preprocessed source(s).
Several other .cc files in the same CL errored-out without an assertion, due to the missing #include.
The changeset was originally several changes, but it seems it is sufficient to remove a single header - see https://chromium-review.googlesource.com/c/chromium/src/+/1166243
Comment 1 by thakis@chromium.org
, Aug 7Components: Build
Labels: clang
Summary: crash-on-invalid: Clang assertion building file that #includes missing header (was: Clang assertion building file that #includes missing header)