[cfe-dev] clang-tidy: SIGSEGV in clang::Type::isDependentType (8.0.1 and llvm-svn: 371920)

Simon Sandström via cfe-dev cfe-dev at lists.llvm.org
Sun Sep 15 01:54:21 PDT 2019


On 15/09, Csaba Raduly wrote:
> On Sun, Sep 15, 2019 at 12:35 AM Simon Sandström via cfe-dev
> <cfe-dev at lists.llvm.org> wrote:
> >
> > On 14/09, Simon Sandström wrote:
> > > Hi,
> > >
> > > I'm getting a segmentation fault when running clang-tidy. It happens
> > > both on clang-tidy-8 installed on Debian testing (1:8.0.1-3+b1) and
> > > built on llvm-svn: 371920 (git commit 8f6d40e9b1 on github
> > > llvm/llvm-project).
> 
> Does the compiler itself (clang++) crash (segfault) when presented
> with the same source file ?
> 
> Csaba
> -- 
> You can get very substantial performance improvements
> by not doing the right thing. - Scott Meyers, An Effective C++11/14 Sampler
> So if you're looking for a completely portable, 100% standards-conformant way
> to get the wrong information: this is what you want. - Scott Meyers (C++TDaWYK)

Yes it does. I didn't know that before as I use gcc/g++ to compile.
See output below. Not sure if I can attach the source in the mail as
they are 15M. I guess that I just should submit a regular bug report
and attach it there. Currently waiting for an account to be created.

- Simon

---

fatal error: too many errors emitted, stopping now [-ferror-limit=]
Stack dump:
0.      Program arguments: /usr/lib/llvm-8/bin/clang -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name a.cc -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -coverage-notes-file /home/simon/tmp/game_engine.cc.gcno -resource-dir /usr/lib/llvm-8/lib/clang/8.0.1 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/x86_64-linux-gnu/c++/9 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/x86_64-linux-gnu/c++/9 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/backward -internal-isystem /usr/include/clang/8.0.1/include/ -internal-isystem /usr/local/include -internal-isystem /usr/lib/llvm-8/lib/clang/8.0.1/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wall -Wextra -Werror -pedantic -std=c++17 -fdeprecated-macro -fdebug-compilation-dir /home/simon/tmp -ferror-limit 19 -fmessage-length 237 -pthread -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o game_engine.cc.o -x c++ /home/simon/tmp/a.cc -faddrsig
1.      /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/stl_map.h:1439:46: current parser token ';'
2.      /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/ostream:41:1: parsing namespace 'std'
3.      /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/stl_map.h:66:1: parsing namespace 'std::std'
 #0 0x00007f6c31b8cf0f llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/lib/x86_64-linux-gnu/libLLVM-8.so.1+0xa9af0f)
 #1 0x00007f6c31b8b340 llvm::sys::RunSignalHandlers() (/usr/lib/x86_64-linux-gnu/libLLVM-8.so.1+0xa99340)
 #2 0x00007f6c31b8d318 (/usr/lib/x86_64-linux-gnu/libLLVM-8.so.1+0xa9b318)
 #3 0x00007f6c34e30510 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x13510)
 #4 0x0000000001a7da25 clang::NestedNameSpecifier::containsUnexpandedParameterPack() const (/usr/lib/llvm-8/bin/clang+0x1a7da25)
 #5 0x00000000017bacb1 clang::Sema::DiagnoseUnexpandedParameterPack(clang::CXXScopeSpec const&, clang::Sema::UnexpandedParameterPackContext) (/usr/lib/llvm-8/bin/clang+0x17bacb1)
 #6 0x000000000139069e clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>) (/usr/lib/llvm-8/bin/clang+0x139069e)
 #7 0x0000000001390548 clang::Sema::ActOnDeclarator(clang::Scope*, clang::Declarator&) (/usr/lib/llvm-8/bin/clang+0x1390548)
 #8 0x000000000120f460 clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (/usr/lib/llvm-8/bin/clang+0x120f460)
 #9 0x000000000120e1f0 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/usr/lib/llvm-8/bin/clang+0x120e1f0)
#10 0x00000000011f74ba clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/usr/lib/llvm-8/bin/clang+0x11f74ba)
#11 0x00000000011f6ee8 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/usr/lib/llvm-8/bin/clang+0x11f6ee8)
#12 0x00000000011f5e63 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/usr/lib/llvm-8/bin/clang+0x11f5e63)
#13 0x000000000121fb9a clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (/usr/lib/llvm-8/bin/clang+0x121fb9a)
#14 0x000000000121f777 clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) (/usr/lib/llvm-8/bin/clang+0x121f777)
#15 0x0000000001209d54 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) (/usr/lib/llvm-8/bin/clang+0x1209d54)
#16 0x00000000011f5357 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/usr/lib/llvm-8/bin/clang+0x11f5357)
#17 0x000000000121fb9a clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (/usr/lib/llvm-8/bin/clang+0x121fb9a)
#18 0x000000000121f777 clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) (/usr/lib/llvm-8/bin/clang+0x121f777)
#19 0x0000000001209d54 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&) (/usr/lib/llvm-8/bin/clang+0x1209d54)
#20 0x00000000011f5357 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/usr/lib/llvm-8/bin/clang+0x11f5357)
#21 0x00000000011f4c78 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) (/usr/lib/llvm-8/bin/clang+0x11f4c78)
#22 0x00000000011f06b6 clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/llvm-8/bin/clang+0x11f06b6)
#23 0x0000000000b0545f clang::FrontendAction::Execute() (/usr/lib/llvm-8/bin/clang+0xb0545f)
#24 0x0000000000ac3168 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/llvm-8/bin/clang+0xac3168)
#25 0x0000000000b8a936 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/llvm-8/bin/clang+0xb8a936)
#26 0x00000000006d053a cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/lib/llvm-8/bin/clang+0x6d053a)
#27 0x00000000006cea36 main (/usr/lib/llvm-8/bin/clang+0x6cea36)
#28 0x00007f6c30c21bbb __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26bbb)
#29 0x00000000006cc12a _start (/usr/lib/llvm-8/bin/clang+0x6cc12a)
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 8.0.1-3+b1 (tags/RELEASE_801/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/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:
********************

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

********************



More information about the cfe-dev mailing list