[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
Sat Sep 14 14:11:31 PDT 2019


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).

gdb output below, sorry if it's messy:

---

(gdb) bt
#0  0x0000555555f80a94 in clang::Type::isDependentType (this=0x107060707070007) at llvm-project/clang/include/clang/AST/Type.h:2111
#1  clang::NestedNameSpecifier::isDependent (this=this at entry=0x555558a9b010) at llvm-project/clang/lib/AST/NestedNameSpecifier.cpp:224
#2  0x0000555556f22d75 in clang::Sema::computeDeclContext (this=this at entry=0x555558bb7400, SS=..., EnteringContext=EnteringContext at entry=true)
    at llvm-project/clang/lib/Sema/SemaCXXScopeSpec.cpp:80
#3  0x0000555556f232c1 in clang::Sema::ActOnCXXEnterDeclaratorScope (this=0x555558bb7400, S=0x55555a5c8440, SS=...) at llvm-project/clang/lib/Sema/SemaCXXScopeSpec.cpp:1074
#4  0x0000555556cb418c in clang::Parser::DeclaratorScopeObj::EnterDeclaratorScope (this=<synthetic pointer>) at llvm-project/clang/include/clang/Sema/Sema.h:11233
#5  clang::Parser::ParseDirectDeclarator (this=0x555558b7d960, D=...) at llvm-project/clang/lib/Parse/ParseDecl.cpp:5761
#6  0x0000555556caa007 in clang::Parser::ParseDeclaratorInternal (this=this at entry=0x555558b7d960, D=..., DirectDeclParser=<optimized out>)
    at llvm-project/clang/lib/Parse/ParseDecl.cpp:5577
#7  0x0000555556caae3e in clang::Parser::ParseDeclarator (this=this at entry=0x555558b7d960, D=...) at llvm-project/clang/lib/Parse/ParseDecl.cpp:5445
#8  0x0000555556cadb41 in clang::Parser::ParseDeclGroup (this=this at entry=0x555558b7d960, DS=..., Context=Context at entry=clang::DeclaratorContext::FileContext, DeclEnd=DeclEnd at entry=0x0, FRI=FRI at entry=0x0)
    at llvm-project/clang/lib/Parse/ParseDecl.cpp:2009
#9  0x0000555556c823ea in clang::Parser::ParseDeclOrFunctionDefInternal (this=this at entry=0x555558b7d960, attrs=..., DS=..., AS=AS at entry=clang::AS_none)
    at llvm-project/clang/lib/Parse/Parser.cpp:1095
#10 0x0000555556c82a55 in clang::Parser::ParseDeclarationOrFunctionDefinition (this=0x555558b7d960, attrs=..., AS=clang::AS_none, DS=<optimized out>)
    at llvm-project/clang/lib/Parse/Parser.cpp:1111
#11 0x0000555556c8b2a0 in clang::Parser::ParseExternalDeclaration (this=this at entry=0x555558b7d960, attrs=..., DS=DS at entry=0x0) at llvm-project/clang/lib/Parse/Parser.cpp:931
#12 0x0000555556cc0eb9 in clang::Parser::ParseInnerNamespace (this=this at entry=0x555558b7d960, InnerNSs=..., index=index at entry=0, InlineLoc=..., attrs=..., Tracker=...)
    at llvm-project/clang/lib/Parse/ParseDeclCXX.cpp:246
#13 0x0000555556cc1b2c in clang::Parser::ParseNamespace (this=this at entry=0x555558b7d960, Context=Context at entry=clang::DeclaratorContext::FileContext, DeclEnd=..., InlineLoc=...)
    at llvm-project/clang/lib/Parse/ParseDeclCXX.cpp:224
#14 0x0000555556cb13e1 in clang::Parser::ParseDeclaration (this=this at entry=0x555558b7d960, Context=Context at entry=clang::DeclaratorContext::FileContext, DeclEnd=..., attrs=..., 
    DeclSpecStart=DeclSpecStart at entry=0x0) at llvm-project/clang/include/clang/Basic/SourceLocation.h:86
#15 0x0000555556c8ab2e in clang::Parser::ParseExternalDeclaration (this=this at entry=0x555558b7d960, attrs=..., DS=DS at entry=0x0) at llvm-project/clang/lib/Parse/Parser.cpp:885
#16 0x0000555556cc0eb9 in clang::Parser::ParseInnerNamespace (this=this at entry=0x555558b7d960, InnerNSs=..., index=index at entry=0, InlineLoc=..., attrs=..., Tracker=...)
    at llvm-project/clang/lib/Parse/ParseDeclCXX.cpp:246
#17 0x0000555556cc1b2c in clang::Parser::ParseNamespace (this=this at entry=0x555558b7d960, Context=Context at entry=clang::DeclaratorContext::FileContext, DeclEnd=..., InlineLoc=...)
    at llvm-project/clang/lib/Parse/ParseDeclCXX.cpp:224
#18 0x0000555556cb13e1 in clang::Parser::ParseDeclaration (this=this at entry=0x555558b7d960, Context=Context at entry=clang::DeclaratorContext::FileContext, DeclEnd=..., attrs=..., 
    DeclSpecStart=DeclSpecStart at entry=0x0) at llvm-project/clang/include/clang/Basic/SourceLocation.h:86
#19 0x0000555556c8ab2e in clang::Parser::ParseExternalDeclaration (this=this at entry=0x555558b7d960, attrs=..., DS=DS at entry=0x0) at llvm-project/clang/lib/Parse/Parser.cpp:885
#20 0x0000555556c8bd1d in clang::Parser::ParseTopLevelDecl (this=this at entry=0x555558b7d960, Result=..., IsFirstDecl=IsFirstDecl at entry=false) at llvm-project/clang/lib/Parse/Parser.cpp:682
#21 0x0000555556c7df59 in clang::ParseAST (S=..., PrintStats=<optimized out>, SkipFunctionBodies=<optimized out>) at llvm-project/clang/lib/Parse/ParseAST.cpp:157
#22 0x0000555556b082e1 in clang::FrontendAction::Execute (this=this at entry=0x555558b05120) at llvm-project/clang/lib/Frontend/FrontendAction.cpp:935
#23 0x0000555556ac505b in clang::CompilerInstance::ExecuteAction (this=this at entry=0x7fffffffc9b0, Act=warning: RTTI symbol not found for class 'clang::tidy::runClangTidy(clang::tidy::ClangTidyContext&, clang::to
oling::CompilationDatabase const&, llvm::ArrayRef<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem>, bool, llvm::StringRef)
::ActionFactory::Action'
...) at llvm-project/clang/lib/Frontend/CompilerInstance.cpp:957
#24 0x0000555556513c46 in clang::tooling::FrontendActionFactory::runInvocation (this=<optimized out>, Invocation=std::shared_ptr<clang::CompilerInvocation> (empty) = {...}, Files=0x555558af83a0, 
    PCHContainerOps=std::shared_ptr<clang::PCHContainerOperations> (empty) = {...}, DiagConsumer=0x7fffffffd7d0) at /usr/include/c++/9/bits/unique_ptr.h:352
#25 0x00005555560f60a3 in clang::tidy::ActionFactory::runInvocation (this=<optimized out>, Invocation=..., Files=<optimized out>, PCHContainerOps=..., DiagConsumer=<optimized out>)
    at /usr/include/c++/9/ext/atomicity.h:96
#26 0x000055555650cd49 in clang::tooling::ToolInvocation::runInvocation (this=this at entry=0x7fffffffd690, BinaryName=BinaryName at entry=0x555558ae70a0 "/usr/bin/c++", Compilation=Compilation at entry=0x555558aedec0, 
    Invocation=std::shared_ptr<clang::CompilerInvocation> (empty) = {...}, PCHContainerOps=std::shared_ptr<clang::PCHContainerOperations> (empty) = {...}) at /usr/include/c++/9/bits/shared_ptr_base.h:1176
#27 0x0000555556511214 in clang::tooling::ToolInvocation::run (this=this at entry=0x7fffffffd690) at /usr/include/c++/9/bits/shared_ptr_base.h:1388
#28 0x0000555556512dd7 in clang::tooling::ClangTool::run (this=this at entry=0x7fffffffd820, Action=Action at entry=0x7fffffffd7b0) at llvm-project/clang/lib/Tooling/Tooling.cpp:523
#29 0x00005555560f7026 in clang::tidy::runClangTidy (Context=..., Compilations=..., InputFiles=..., BaseFS=..., EnableCheckProfile=false, StoreCheckProfile=...)
    at llvm-project/clang-tools-extra/clang-tidy/ClangTidy.cpp:567
#30 0x0000555555a816bb in clang::tidy::clangTidyMain (argc=<optimized out>, argv=<optimized out>) at /usr/include/c++/9/bits/unique_ptr.h:352
#31 0x00007ffff7a3209b in __libc_start_main (main=0x555555a6cba0 <main(int, char const**)>, argc=6, argv=0x7fffffffe9f8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, 
    stack_end=0x7fffffffe9e8) at ../csu/libc-start.c:308
#32 0x0000555555a7691a in _start () at llvm-project/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp:492

(gdb) info frame
Stack level 0, frame at 0x7fffffffaff0:
 rip = 0x555555f80a94 in clang::Type::isDependentType (llvm-project/clang/include/clang/AST/Type.h:2111); saved rip = 0x555556f22d75
 inlined into frame 1
 source language c++.
 Arglist at unknown address.
 Locals at unknown address, Previous frame's sp in rsp

(gdb) info args
this = 0x107060707070007

---

Is this crash known/reported? I can give you more info if needed, or try
to attach the source files but I'm not sure how much is needed in order
to reproduce the crash.

Thanks
 - Simon



More information about the cfe-dev mailing list