llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.16k stars 12.03k forks source link

Crash while handling incomplete type of nested name specifier #28293

Closed llvmbot closed 8 years ago

llvmbot commented 8 years ago
Bugzilla Link 27919
Resolution WORKSFORME
Resolved on Jun 02, 2016 13:23
Version trunk
OS Linux
Attachments URL of zip archive containing preprocessed source and run script
Reporter LLVM Bugzilla Contributor
CC @hfinkel,@nico,@rnk

Extended Description

Got the following crash while accidentally compiling a program which referred to a nested name specifier of an incomplete type (not forward-declared, not declared).

clang version 3.9.0 (trunk 270823).

FAILED: obj/third_party/WebKit/Source/modules/modules/EXTTextureFilterAnisotropic.o /usr/local/google/home/kbr/goma/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/third_party/WebKit/Source/modules/modules/EXTTextureFilterAnisotropic.o.d -DBLINK_MODULES_IMPLEMENTATION=1 -DV8_DEPRECATION_WARNINGS -DENABLE_MDNS=1 -DENABLE_NOTIFICATIONS -DENABLE_PEPPER_CDMS -DENABLE_PLUGINS=1 -DENABLE_PDF=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DDCHECK_ALWAYS_ON=1 -DUSE_UDEV -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_CLIPBOARD_AURAX11=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_X11=1 -DENABLE_WEBRTC=1 -DENABLE_EXTENSIONS=1 -DENABLE_TASK_MANAGER=1 -DENABLE_THEMES=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_SERVICE_DISCOVERY=1 -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DENABLE_MEDIA_ROUTER=1 -DFIELDTRIAL_TESTING_ENABLED -DCR_CLANG_REVISION=270823-1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DSTDC_CONSTANT_MACROS -DSTDC_FORMAT_MACROS -DCOMPONENT_BUILD -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -D_GLIBCXX_DEBUG=1 -DBLINK_IMPLEMENTATION=1 -DINSIDE_BLINK -DENABLE_LAYOUT_UNIT_IN_INLINE_BOXES=0 -DENABLE_OILPAN=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1 -DWTF_USE_ICCJPEG=1 -DWTF_USE_QCMSLIB=1 -DWTF_USE_WEBAUDIO_FFMPEG=1 -DWTF_USE_DEFAULT_RENDER_THEME=1 -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DU_NOEXCEPT= -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -DMOJO_USE_SYSTEM_IMPL -DGL_GLEXT_PROTOTYPES -DUSE_GLX -DUSE_EGL -DSK_SUPPORT_LEGACY_TYPEFACE_MAKE_FROM_NAME -DSK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -DSKIA_DLL -DGR_GL_IGNORE_ES3_MSAA=0 -DSK_SUPPORT_GPU=1 -DANGLE_ENABLE_RELEASE_ASSERTS -DCHROME_PNG_WRITE_SUPPORT -DPNG_USER_CONFIG -DLIBXSLT_STATIC -DV8_SHARED -DUSING_V8_SHARED -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DHAVE_PTHREAD -DPROTOBUF_USE_DLLS -DBORINGSSL_SHARED_LIBRARY -DUSE_LIBJPEG_TURBO=1 -I../.. -Igen -I../../third_party/WebKit/Source -I../../third_party/WebKit -Igen/blink -Igen/third_party/WebKit -I../../build/linux/debian_wheezy_amd64-sysroot/usr/include/glib-2.0 -I../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/x86_64-linux-gnu/glib-2.0/include -I../../third_party/icu/source/common -I../../third_party/icu/source/i18n -I../../third_party/khronos -I../../gpu -I../../third_party/libwebp -I../../third_party/WebKit/Source -Igen/blink -I../../skia/config -I../../skia/ext -I../../third_party/skia/include/c -I../../third_party/skia/include/config -I../../third_party/skia/include/core -I../../third_party/skia/include/effects -I../../third_party/skia/include/images -I../../third_party/skia/include/lazy -I../../third_party/skia/include/pathops -I../../third_party/skia/include/pdf -I../../third_party/skia/include/pipe -I../../third_party/skia/include/ports -I../../third_party/skia/include/utils -I../../third_party/skia/include/gpu -I../../third_party/skia/src/gpu -I../../third_party/angle/include -Igen/angle -I../../third_party/iccjpeg -I../../third_party/libpng -I../../third_party/zlib -I../../third_party/libxml/src/include -I../../third_party/libxml/linux/include -I../../third_party/libxslt -I../../third_party/ots/include -I../../third_party/qcms/src -I../../third_party/snappy/src -I../../third_party/snappy/linux -I../../v8/include -I../../third_party/mesa/src/include -I../../third_party/protobuf/src -Igen/protoc_out -I../../third_party/protobuf/src -I../../build/linux/debian_wheezy_amd64-sysroot/usr/include/nss -I../../build/linux/debian_wheezy_amd64-sysroot/usr/include/nspr -I../../third_party/boringssl/src/include -I../../third_party/libjpeg_turbo -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pipe -B../../third_party/binutils/Linux_x64/Release/bin -fcolor-diagnostics -fdebug-prefix-map=/usr/local/google/home/kbr/src/chrome/src=. -pthread -m64 -march=x86-64 -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-deprecated-register -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wno-undefined-var-template -O0 -g1 -gsplit-dwarf --sysroot=../../build/linux/debian_wheezy_amd64-sysroot -fvisibility=hidden -Xclang -load -Xclang ../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-templates -Xclang -plugin-arg-find-bad-constructs -Xclang follow-macro-expansion -Xclang -plugin-arg-find-bad-constructs -Xclang check-implicit-copy-ctors -Xclang -plugin-arg-find-bad-constructs -Xclang check-ipc -Wheader-hygiene -Wstring-conversion -Xclang -load -Xclang ../../third_party/llvm-build/Release+Asserts/lib/libBlinkGCPlugin.so -Xclang -add-plugin -Xclang blink-gc-plugin -DLIBXML_STATIC= -Wno-header-guard -fno-threadsafe-statics -fvisibility-inlines-hidden -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=gnu++11 -fno-rtti -fno-exceptions -c ../../third_party/WebKit/Source/modules/webgl/EXTTextureFilterAnisotropic.cpp -o obj/third_party/WebKit/Source/modules/modules/EXTTextureFilterAnisotropic.o 0 clang 0x00000000019b7c08 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40 1 clang 0x00000000019b5e06 llvm::sys::RunSignalHandlers() + 54 2 clang 0x00000000019b82de 3 libpthread.so.0 0x00007eff3316a340 4 clang 0x0000000001ae3023 5 clang 0x0000000001ae2dba clang::SourceManager::getLineNumber(clang::FileID, unsigned int, bool) const + 186 6 clang 0x0000000001ae2a5a clang::SourceManager::getPresumedLoc(clang::SourceLocation, bool) const + 218 7 clang 0x0000000001f72fd3 clang::DiagnosticRenderer::emitDiagnostic(clang::SourceLocation, clang::DiagnosticsEngine::Level, llvm::StringRef, llvm::ArrayRef, llvm::ArrayRef, clang::SourceManager const, llvm::PointerUnion<clang::Diagnostic const, clang::StoredDiagnostic const>) + 1587 8 clang 0x0000000001f3384e clang::TextDiagnosticPrinter::HandleDiagnostic(clang::DiagnosticsEngine::Level, clang::Diagnostic const&) + 1374 9 clang 0x0000000001adc066 clang::DiagnosticIDs::ProcessDiag(clang::DiagnosticsEngine&) const + 438 10 clang 0x0000000001ad6dea clang::DiagnosticsEngine::EmitCurrentDiagnostic(bool) + 90 11 clang 0x0000000002825d8c clang::Sema::EmitCurrentDiagnostic(unsigned int) + 348 12 clang 0x00000000028d2b1f clang::Sema::DiagnoseUnknownTypeName(clang::IdentifierInfo&, clang::SourceLocation, clang::Scope, clang::CXXScopeSpec, clang::OpaquePtr&, bool) + 2271 13 clang 0x000000000261a9a4 clang::Parser::ParseImplicitInt(clang::DeclSpec&, clang::CXXScopeSpec, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::ParsedAttributesWithRange&) + 2964 14 clang 0x0000000002615403 clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList) + 8675 15 clang 0x00000000025ff07f clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) + 63 16 clang 0x00000000025fed40 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec, clang::AccessSpecifier) + 416 17 clang 0x00000000025fde24 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec) + 2180 18 clang 0x00000000025fd407 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr&) + 359 19 clang 0x00000000025f9266 clang::ParseAST(clang::Sema&, bool, bool) + 518 20 clang 0x0000000001ee32a5 clang::FrontendAction::Execute() + 69 21 clang 0x0000000001eab091 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1073 22 clang 0x0000000001f7c431 clang::ExecuteCompilerInvocation(clang::CompilerInstance) + 3505 23 clang 0x000000000075811e cc1_main(llvm::ArrayRef<char const>, char const, void*) + 1022 24 clang 0x00000000007565ca main + 10538 25 libc.so.6 0x00007eff3237eec5 __libc_start_main + 245 26 clang 0x0000000000753b92 Stack dump:

  1. Program arguments: /usr/local/google/home/kbr/src/chrome/src/third_party/llvm-build/Release+Asserts/bin/clang -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name EXTTextureFilterAnisotropic.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -relaxed-aliasing -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info -backend-option -split-dwarf=Enable -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -coverage-file /usr/local/google/home/kbr/src/chrome/src/out/Debug/obj/third_party/WebKit/Source/modules/modules/EXTTextureFilterAnisotropic.o -resource-dir /usr/local/google/home/kbr/src/chrome/src/third_party/llvm-build/Release+Asserts/bin/../lib/clang/3.9.0 -dependency-file obj/third_party/WebKit/Source/modules/modules/EXTTextureFilterAnisotropic.o.d -MT obj/third_party/WebKit/Source/modules/modules/EXTTextureFilterAnisotropic.o -D BLINK_MODULES_IMPLEMENTATION=1 -D V8_DEPRECATION_WARNINGS -D ENABLE_MDNS=1 -D ENABLE_NOTIFICATIONS -D ENABLE_PEPPER_CDMS -D ENABLE_PLUGINS=1 -D ENABLE_PDF=1 -D ENABLE_PRINTING=1 -D ENABLE_BASIC_PRINTING=1 -D ENABLE_PRINT_PREVIEW=1 -D ENABLE_SPELLCHECK=1 -D DCHECK_ALWAYS_ON=1 -D USE_UDEV -D UI_COMPOSITOR_IMAGE_TRANSPORT -D USE_AURA=1 -D USE_PANGO=1 -D USE_CAIRO=1 -D USE_CLIPBOARD_AURAX11=1 -D USE_DEFAULT_RENDER_THEME=1 -D USE_GLIB=1 -D USE_NSS_CERTS=1 -D USE_X11=1 -D ENABLE_WEBRTC=1 -D ENABLE_EXTENSIONS=1 -D ENABLE_TASK_MANAGER=1 -D ENABLE_THEMES=1 -D ENABLE_CAPTIVE_PORTAL_DETECTION=1 -D ENABLE_SESSION_SERVICE=1 -D ENABLE_SUPERVISED_USERS=1 -D ENABLE_SERVICE_DISCOVERY=1 -D FULL_SAFE_BROWSING -D SAFE_BROWSING_CSD -D SAFE_BROWSING_DB_LOCAL -D CHROMIUM_BUILD -D ENABLE_MEDIA_ROUTER=1 -D FIELDTRIAL_TESTING_ENABLED -D CR_CLANG_REVISION=270823-1 -D _FILE_OFFSET_BITS=64 -D _LARGEFILE_SOURCE -D _LARGEFILE64_SOURCE -D STDC_CONSTANT_MACROS -D STDC_FORMAT_MACROS -D COMPONENT_BUILD -D _DEBUG -D DYNAMIC_ANNOTATIONS_ENABLED=1 -D WTF_USE_DYNAMIC_ANNOTATIONS=1 -D _GLIBCXX_DEBUG=1 -D BLINK_IMPLEMENTATION=1 -D INSIDE_BLINK -D ENABLE_LAYOUT_UNIT_IN_INLINE_BOXES=0 -D ENABLE_OILPAN=1 -D WTF_USE_DYNAMIC_ANNOTATIONS=1 -D WTF_USE_CONCATENATED_IMPULSE_RESPONSES=1 -D WTF_USE_ICCJPEG=1 -D WTF_USE_QCMSLIB=1 -D WTF_USE_WEBAUDIO_FFMPEG=1 -D WTF_USE_DEFAULT_RENDER_THEME=1 -D U_USING_ICU_NAMESPACE=0 -D U_ENABLE_DYLOAD=0 -D U_NOEXCEPT= -D ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -D MOJO_USE_SYSTEM_IMPL -D GL_GLEXT_PROTOTYPES -D USE_GLX -D USE_EGL -D SK_SUPPORT_LEGACY_TYPEFACE_MAKE_FROM_NAME -D SK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -D SKIA_DLL -D GR_GL_IGNORE_ES3_MSAA=0 -D SK_SUPPORT_GPU=1 -D ANGLE_ENABLE_RELEASE_ASSERTS -D CHROME_PNG_WRITE_SUPPORT -D PNG_USER_CONFIG -D LIBXSLT_STATIC -D V8_SHARED -D USING_V8_SHARED -D GOOGLE_PROTOBUF_NO_RTTI -D GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -D HAVE_PTHREAD -D PROTOBUF_USE_DLLS -D BORINGSSL_SHARED_LIBRARY -D USE_LIBJPEG_TURBO=1 -I ../.. -I gen -I ../../third_party/WebKit/Source -I ../../third_party/WebKit -I gen/blink -I gen/third_party/WebKit -I ../../build/linux/debian_wheezy_amd64-sysroot/usr/include/glib-2.0 -I ../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/x86_64-linux-gnu/glib-2.0/include -I ../../third_party/icu/source/common -I ../../third_party/icu/source/i18n -I ../../third_party/khronos -I ../../gpu -I ../../third_party/libwebp -I ../../third_party/WebKit/Source -I gen/blink -I ../../skia/config -I ../../skia/ext -I ../../third_party/skia/include/c -I ../../third_party/skia/include/config -I ../../third_party/skia/include/core -I ../../third_party/skia/include/effects -I ../../third_party/skia/include/images -I ../../third_party/skia/include/lazy -I ../../third_party/skia/include/pathops -I ../../third_party/skia/include/pdf -I ../../third_party/skia/include/pipe -I ../../third_party/skia/include/ports -I ../../third_party/skia/include/utils -I ../../third_party/skia/include/gpu -I ../../third_party/skia/src/gpu -I ../../third_party/angle/include -I gen/angle -I ../../third_party/iccjpeg -I ../../third_party/libpng -I ../../third_party/zlib -I ../../third_party/libxml/src/include -I ../../third_party/libxml/linux/include -I ../../third_party/libxslt -I ../../third_party/ots/include -I ../../third_party/qcms/src -I ../../third_party/snappy/src -I ../../third_party/snappy/linux -I ../../v8/include -I ../../third_party/mesa/src/include -I ../../third_party/protobuf/src -I gen/protoc_out -I ../../third_party/protobuf/src -I ../../build/linux/debian_wheezy_amd64-sysroot/usr/include/nss -I ../../build/linux/debian_wheezy_amd64-sysroot/usr/include/nspr -I ../../third_party/boringssl/src/include -I ../../third_party/libjpeg_turbo -D LIBXML_STATIC= -isysroot ../../build/linux/debian_wheezy_amd64-sysroot -internal-isystem ../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6 -internal-isystem ../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/x86_64-linux-gnu -internal-isystem ../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/backward -internal-isystem ../../build/linux/debian_wheezy_amd64-sysroot/usr/local/include -internal-isystem /usr/local/google/home/kbr/src/chrome/src/third_party/llvm-build/Release+Asserts/bin/../lib/clang/3.9.0/include -internal-externc-isystem ../../build/linux/debian_wheezy_amd64-sysroot/usr/include/x86_64-linux-gnu -internal-externc-isystem ../../build/linux/debian_wheezy_amd64-sysroot/include -internal-externc-isystem ../../build/linux/debian_wheezy_amd64-sysroot/usr/include -O0 -Wall -Werror -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-deprecated-register -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wno-undefined-var-template -Wheader-hygiene -Wstring-conversion -Wno-header-guard -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=gnu++11 -fdeprecated-macro -fdebug-compilation-dir /usr/local/google/home/kbr/src/chrome/src/out/Debug -fdebug-prefix-map=/usr/local/google/home/kbr/src/chrome/src=. -ferror-limit 19 -fmessage-length 0 -fvisibility hidden -fvisibility-inlines-hidden -pthread -stack-protector 1 -stack-protector-buffer-size 4 -fno-rtti -fno-threadsafe-statics -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -load ../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -add-plugin find-bad-constructs -plugin-arg-find-bad-constructs check-templates -plugin-arg-find-bad-constructs follow-macro-expansion -plugin-arg-find-bad-constructs check-implicit-copy-ctors -plugin-arg-find-bad-constructs check-ipc -load ../../third_party/llvm-build/Release+Asserts/lib/libBlinkGCPlugin.so -add-plugin blink-gc-plugin -o obj/third_party/WebKit/Source/modules/modules/EXTTextureFilterAnisotropic.o -x c++ ../../third_party/WebKit/Source/modules/webgl/EXTTextureFilterAnisotropic.cpp -split-dwarf-file obj/third_party/WebKit/Source/modules/modules/EXTTextureFilterAnisotropic.dwo
  2. clang: error: unable to execute command: Segmentation fault (core dumped) clang: error: clang frontend command failed due to signal (use -v to see invocation) clang version 3.9.0 (trunk 270823) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /usr/local/google/home/kbr/src/chrome/src/third_party/llvm-build/Release+Asserts/bin clang: 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: note: diagnostic msg:

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/EXTTextureFilterAnisotropic-c9e862.cpp clang: note: diagnostic msg: /tmp/EXTTextureFilterAnisotropic-c9e862.sh clang: note: diagnostic msg:


zmodem commented 8 years ago

I'm not able to reproduce this with the Clang version Ken used, including the Chromium plugins.

Either the bad code didn't get captured in the repro source, or there is some other external dependency.

Since it doesn't reproduce, I'll mark this as worksforme.

Ken, if you happen to have the original source file you used, or can somehow otherwise still reproduce the crash, feel free to reopen.

rnk commented 8 years ago

Hans, can you reproduce and reduce this?

rnk commented 8 years ago

I'm not able to reproduce this locally with a fresh clang. It's possible this is related to the chromium clang plugins.

llvmbot commented 8 years ago

assigned to @zmodem