Issue 171439
Summary clang-tidy crashes on aarch64-linux
Labels clang-tidy
Assignees
Reporter Tom-Hubrecht
    This occured on lix's ci (logs: https://buildkite.com/lix-project/lix/builds/6938/steps/canvas?sid=019b034f-0320-4bac-8f9f-b8d162e47e87 )

The `lix-charptrcast` check is at https://git.lix.systems/lix-project/lix/src/branch/main/subprojects/lix-clang-tidy/CharPtrCast.cc

This crash happens quite reliably over various versions of llvm, in this case it is with 21.1.7

PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
```
Stack dump:
0. Program arguments: /nix/store/jj9i79rfkdngc73ldb3cg3gb3cdq1w8h-clang-tools-21.1.7/bin/clang-tidy -header-filter=lix/[^/]+/.*\\.hh -p=/build/source/build/meson/clang-tidy -quiet -load=/nix/store/kbk5hyvpr304wz4s7a29glcaqqg3fyrq-lix-clang-tidy-checks-0.1/lib/liblix-clang-tidy.so --warnings-as-errors=* /build/source/lix/libutil/users.cc
1. <eof> parser at end of file
2. ASTMatcher: Processing 'lix-charptrcast' against:
 CXXReinterpretCastExpr : </nix/store/35f3jqq1xw3lk9cpg7sb99nbrbgxd9ag-gcc-14.3.0/include/c++/14.3.0/ostream:685:24, col:57>
--- Bound Nodes Begin ---
    reinterpret-cast-expr - { CXXReinterpretCastExpr : </nix/store/35f3jqq1xw3lk9cpg7sb99nbrbgxd9ag-gcc-14.3.0/include/c++/14.3.0/ostream:685:24, col:57> }
--- Bound Nodes End ---
 #0 0x0000ffffeb35aaa8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/nix/store/l3q9imgign3qp9pzi5v3dg8xqgbgyml3-llvm-21.1.7-lib/lib/libLLVM.so.21.1+0xc7aaa8)
 #1 0x0000ffffeb358018 SignalHandler(int, siginfo_t*, void*) (/nix/store/l3q9imgign3qp9pzi5v3dg8xqgbgyml3-llvm-21.1.7-lib/lib/libLLVM.so.21.1+0xc78018)
 #2 0x0000fffff7ffa970 (linux-vdso.so.1+0x970)
 #3 0x0000ffffea24e884 __GI_memcpy (/nix/store/89n0gcl1yjp37ycca45rn50h7lms5p6f-glibc-2.40-66/lib/libc.so.6+0xae884)
 #4 0x0000ffffeb32ce64 llvm::raw_svector_ostream::write_impl(char const*, unsigned long) (/nix/store/l3q9imgign3qp9pzi5v3dg8xqgbgyml3-llvm-21.1.7-lib/lib/libLLVM.so.21.1+0xc4ce64)
 #5 0x0000ffffeb32eb3c llvm::raw_ostream::write(char const*, unsigned long) (/nix/store/l3q9imgign3qp9pzi5v3dg8xqgbgyml3-llvm-21.1.7-lib/lib/libLLVM.so.21.1+0xc4eb3c)
 #6 0x0000ffffeb2f0934 llvm::Twine::str[abi:cxx11]() const (/nix/store/l3q9imgign3qp9pzi5v3dg8xqgbgyml3-llvm-21.1.7-lib/lib/libLLVM.so.21.1+0xc10934)
 #7 0x0000ffffe9eb7e94 nix::clang_tidy::CharPtrCastCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&) (/nix/store/kbk5hyvpr304wz4s7a29glcaqqg3fyrq-lix-clang-tidy-checks-0.1/lib/liblix-clang-tidy.so+0x57e94)
 #8 0x0000fffff553c24c clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::MatchVisitor::visitMatch(clang::ast_matchers::BoundNodes const&) (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0x179c24c)
 #9 0x0000fffff5570044 clang::ast_matchers::internal::BoundNodesTreeBuilder::visitMatches(clang::ast_matchers::internal::BoundNodesTreeBuilder::Visitor*) (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0x17d0044)
#10 0x0000fffff553e748 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::matchWithFilter(clang::DynTypedNode const&) (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0x179e748)
#11 0x0000fffff556a47c clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseExtVectorElementExpr(clang::ExtVectorElementExpr*, llvm::SmallVectorImpl<llvm::PointerIntPair<clang::Stmt*, 1u, bool, llvm::PointerLikeTypeTraits<clang::Stmt*>, llvm::PointerIntPairInfo<clang::Stmt*, 1u, llvm::PointerLikeTypeTraits<clang::Stmt*>>>>*) (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0x17ca47c)
#12 0x0000fffff5561a9c clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseStmt(clang::Stmt*, llvm::SmallVectorImpl<llvm::PointerIntPair<clang::Stmt*, 1u, bool, llvm::PointerLikeTypeTraits<clang::Stmt*>, llvm::PointerIntPairInfo<clang::Stmt*, 1u, llvm::PointerLikeTypeTraits<clang::Stmt*>>>>*) (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0x17c1a9c)
#13 0x0000fffff5561f50 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseStmt(clang::Stmt*, llvm::SmallVectorImpl<llvm::PointerIntPair<clang::Stmt*, 1u, bool, llvm::PointerLikeTypeTraits<clang::Stmt*>, llvm::PointerIntPairInfo<clang::Stmt*, 1u, llvm::PointerLikeTypeTraits<clang::Stmt*>>>>*) (.constprop.0) (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0x17c1f50)
#14 0x0000fffff5564f1c clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseFunctionHelper(clang::FunctionDecl*) (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0x17c4f1c)
#15 0x0000fffff5559554 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0x17b9554)
#16 0x0000fffff555a090 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0x17ba090)
#17 0x0000fffff555a984 clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDeclContextHelper(clang::DeclContext*) (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0x17ba984)
#18 0x0000fffff55692ec clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseHLSLBufferDecl(clang::HLSLBufferDecl*) (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0x17c92ec)
#19 0x0000fffff555920c clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0x17b920c)
#20 0x0000fffff555a984 clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDeclContextHelper(clang::DeclContext*) (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0x17ba984)
#21 0x0000fffff5569518 clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseTranslationUnitDecl(clang::TranslationUnitDecl*) (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0x17c9518)
#22 0x0000fffff5558bc8 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0x17b8bc8)
#23 0x0000fffff555b00c clang::ast_matchers::MatchFinder::matchAST(clang::ASTContext&) (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0x17bb00c)
#24 0x0000fffff6b90d54 clang::MultiplexConsumer::HandleTranslationUnit(clang::ASTContext&) (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0x2df0d54)
#25 0x0000fffff4996210 clang::ParseAST(clang::Sema&, bool, bool) (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0xbf6210)
#26 0x0000fffff6b52dd8 clang::FrontendAction::Execute() (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0x2db2dd8)
#27 0x0000fffff6ae08f8 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0x2d408f8)
#28 0x0000fffff6d62cf8 clang::tooling::FrontendActionFactory::runInvocation(std::shared_ptr<clang::CompilerInvocation>, clang::FileManager*, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticConsumer*) (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0x2fc2cf8)
#29 0x0000aaaaab53935c (/nix/store/jj9i79rfkdngc73ldb3cg3gb3cdq1w8h-clang-tools-21.1.7/bin/clang-tidy+0xa9935c)
#30 0x0000fffff6d5e500 clang::tooling::ToolInvocation::runInvocation(char const*, clang::driver::Compilation*, std::shared_ptr<clang::CompilerInvocation>, std::shared_ptr<clang::PCHContainerOperations>) (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0x2fbe500)
#31 0x0000fffff6d5f4c4 clang::tooling::ToolInvocation::run() (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0x2fbf4c4)
#32 0x0000fffff6d60b90 clang::tooling::ClangTool::run(clang::tooling::ToolAction*) (/nix/store/szzs616jlifb93fy9y168rb92kc8b9yn-clang-21.1.7-lib/lib/libclang-cpp.so.21.1+0x2fc0b90)
#33 0x0000aaaaab541804 (/nix/store/jj9i79rfkdngc73ldb3cg3gb3cdq1w8h-clang-tools-21.1.7/bin/clang-tidy+0xaa1804)
#34 0x0000aaaaaacc6590 (/nix/store/jj9i79rfkdngc73ldb3cg3gb3cdq1w8h-clang-tools-21.1.7/bin/clang-tidy+0x226590)
#35 0x0000ffffea1c62b4 __libc_start_call_main (/nix/store/89n0gcl1yjp37ycca45rn50h7lms5p6f-glibc-2.40-66/lib/libc.so.6+0x262b4)
#36 0x0000ffffea1c6398 __libc_start_main@GLIBC_2.17 (/nix/store/89n0gcl1yjp37ycca45rn50h7lms5p6f-glibc-2.40-66/lib/libc.so.6+0x26398)
#37 0x0000aaaaaacbe370 (/nix/store/jj9i79rfkdngc73ldb3cg3gb3cdq1w8h-clang-tools-21.1.7/bin/clang-tidy+0x21e370)
/build/source/lix/libutil/users.cc: terminated by signal 11
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to