<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/138405>138405</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-tidy] Segmentation fault in clang::FormatASTNodeDiagnosticArgument
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang,
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
clee01
</td>
</tr>
</table>
<pre>
- version
- clang-tidy: 5.0.1
- g++: 9.3.1
- with -std=c++17
- backtrace
```
#0 0x00007fe61590b976 in clang::FormatASTNodeDiagnosticArgument(clang::DiagnosticsEngine::ArgumentKind, long, llvm::StringRef, llvm::StringRef, llvm::ArrayRef<std::pair<clang::DiagnosticsEngine::ArgumentKind, long> >, llvm::SmallVectorImpl<char>&, void*, llvm::ArrayRef<long>) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangAST.so.5
#1 0x00007fe6151bc32f in clang::Diagnostic::FormatDiagnostic(char const*, char const*, llvm::SmallVectorImpl<char>&) const () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangBasic.so.5
#2 0x00007fe614e7b94b in clang::tidy::ClangTidyDiagnosticConsumer::HandleDiagnostic(clang::DiagnosticsEngine::Level, clang::Diagnostic const&) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangTidy.so.5
#3 0x00007fe6151c0360 in clang::DiagnosticIDs::EmitDiag(clang::DiagnosticsEngine&, clang::DiagnosticIDs::Level) const () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangBasic.so.5
#4 0x00007fe6151c18f2 in clang::DiagnosticIDs::ProcessDiag(clang::DiagnosticsEngine&) const () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangBasic.so.5
#5 0x00007fe6151ba134 in clang::DiagnosticsEngine::EmitCurrentDiagnostic(bool) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangBasic.so.5
#6 0x00007fe612c7b2d6 in clang::tidy::readability::RedundantMemberInitCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangTidyReadabilityModule.so.5
#7 0x00007fe6155b7c2f in clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::MatchVisitor::visitMatch(clang::ast_matchers::BoundNodes const&) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangASTMatchers.so.5
#8 0x00007fe6155d8c2b in clang::ast_matchers::internal::BoundNodesTreeBuilder::visitMatches(clang::ast_matchers::internal::BoundNodesTreeBuilder::Visitor*) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangASTMatchers.so.5
#9 0x00007fe6155bbf45 in clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::matchWithFilter(clang::ast_type_traits::DynTypedNode const&) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangASTMatchers.so.5
#10 0x00007fe6155d0ec8 in clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangASTMatchers.so.5
#11 0x00007fe6155d196a in clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDeclContextHelper(clang::DeclContext*) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangASTMatchers.so.5
#12 0x00007fe6155cff69 in clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDecl(clang::Decl*) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangASTMatchers.so.5
#13 0x00007fe6155d0ed3 in clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangASTMatchers.so.5
#14 0x00007fe6155cfa40 in clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDecl(clang::Decl*) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangASTMatchers.so.5
#15 0x00007fe6155d0ed3 in clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangASTMatchers.so.5
#16 0x00007fe6155d196a in clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDeclContextHelper(clang::DeclContext*) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangASTMatchers.so.5
#17 0x00007fe6155d045a in clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDecl(clang::Decl*) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangASTMatchers.so.5
#18 0x00007fe6155d0ed3 in clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangASTMatchers.so.5
#19 0x00007fe6155d196a in clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDeclContextHelper(clang::DeclContext*) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangASTMatchers.so.5
#20 0x00007fe6155d045a in clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDecl(clang::Decl*) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangASTMatchers.so.5
#21 0x00007fe6155d0ed3 in clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangASTMatchers.so.5
#22 0x00007fe6155d196a in clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDeclContextHelper(clang::DeclContext*) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangASTMatchers.so.5
#23 0x00007fe6155d045a in clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDecl(clang::Decl*) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangASTMatchers.so.5
#24 0x00007fe6155d0ed3 in clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangASTMatchers.so.5
#25 0x00007fe6155d196a in clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDeclContextHelper(clang::DeclContext*) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangASTMatchers.so.5
#26 0x00007fe6155cfab1 in clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDecl(clang::Decl*) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangASTMatchers.so.5
#27 0x00007fe6155d0ed3 in clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangASTMatchers.so.5
#28 0x00007fe6155d126b in clang::ast_matchers::MatchFinder::matchAST(clang::ASTContext&) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangASTMatchers.so.5
#29 0x00007fe610c4b078 in clang::MultiplexConsumer::HandleTranslationUnit(clang::ASTContext&) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/../lib64/libclangFrontend.so.5
#30 0x00007fe60e8476cb in clang::ParseAST(clang::Sema&, bool, bool) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/../lib64/../lib64/libclangParse.so.5
#31 0x00007fe610c2429e in clang::FrontendAction::Execute() () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/../lib64/libclangFrontend.so.5
#32 0x00007fe610becc85 in clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/../lib64/libclangFrontend.so.5
#33 0x00007fe61299276a in clang::tooling::FrontendActionFactory::runInvocation(std::shared_ptr<clang::CompilerInvocation>, clang::FileManager*, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticConsumer*) ()
from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangTooling.so.5
#34 0x00007fe61298b9ec in clang::tooling::ToolInvocation::runInvocation(char const*, clang::driver::Compilation*, std::shared_ptr<clang::CompilerInvocation>, std::shared_ptr<clang::PCHContainerOperations>) ()
from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangTooling.so.5
#35 0x00007fe61299019e in clang::tooling::ToolInvocation::run() () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangTooling.so.5
#36 0x00007fe6129913e3 in clang::tooling::ClangTool::run(clang::tooling::ToolAction*) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangTooling.so.5
#37 0x00007fe614e639e2 in clang::tidy::runClangTidy(clang::tidy::ClangTidyContext&, clang::tooling::CompilationDatabase const&, llvm::ArrayRef<std::string>, clang::tidy::ProfileData*) () from /opt/rh/llvm-toolset-7/root/usr/bin/../lib64/libclangTidy.so.5
#38 0x0000000000429dc8 in clang::tidy::clangTidyMain(int, char const**) ()
#39 0x00007fe611611555 in __libc_start_main () from /usr/lib64/libc.so.6
#40 0x00000000004193be in _start ()
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzsWk1v4zgS_TXyRYhBUd8HHxQ7Rge72W0k3tljQFFlmzsSaZCUt_PvB5TkWKKcdmZ64g7Qbhhwq0RR9V69IitmEaXYhgPMnPDWCRcTUuutkDNaAiBvkoviZXbj7kEqJriDMte9cWlJ-OZGs-LF8TM3nKKp193ZOPjWfPzMTaf-q_n_TG_dG6ULx1_QdogXOyi7cXNCf9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