-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Closed as duplicate of#113652
Copy link
Labels
clang-tidycrashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]duplicateResolved as duplicateResolved as duplicate
Description
I'm not sure if this is the same as #113652 or not, but after upgrading clang-tidy to version 19.1.7 (from 18.1.6) I've noticed some crashes caused by modernize-use-designated-initializers, for example:
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /opt/misc/llvm-19.1.7/bin/clang-tidy --config-file /home/[...stripped...].clang-tidy -p /home/[...stripped...]/compile_commands.json --use-color=false --enable-check-profile --header-filter=.*ConfigurationLoader\\.h [...stripped...]/ConfigurationLoader.cpp
1. <eof> parser at end of file
2. ASTMatcher: Matching 'modernize-use-designated-initializers' against:
InitListExpr : </opt/[...stripped....]/call_context.h:23:53, col:58>
#0 0x00007c43a4edd0db llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/misc/llvm-19.1.7/bin/../lib/../lib/libLLVMSupport.so.19.1+0x1820db)
#1 0x00007c43a4edac74 llvm::sys::RunSignalHandlers() (/opt/misc/llvm-19.1.7/bin/../lib/../lib/libLLVMSupport.so.19.1+0x17fc74)
#2 0x00007c43a4edb076 (/opt/misc/llvm-19.1.7/bin/../lib/../lib/libLLVMSupport.so.19.1+0x180076)
#3 0x00007c43a6183670 __restore_rt (/lib64/libc.so.6+0x4e670)
#4 0x00007c43a5527e20 (/opt/misc/llvm-19.1.7/bin/../lib/../lib/libclangTidyModernizeModule.so.19.1+0x1c0e20)
#5 0x00007c43a4a2fc6d clang::ast_matchers::internal::DynTypedMatcher::matchesNoKindCheck(clang::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x5fc6d)
#6 0x00007c43a4a2fead (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x5fead)
#7 0x00007c43a4a332ec (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x632ec)
#8 0x00007c43a4a2faae clang::ast_matchers::internal::DynTypedMatcher::matches(clang::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x5faae)
#9 0x00007c43a6701ce1 (/opt/misc/llvm-19.1.7/bin/../lib/../lib/libclangTidyAndroidModule.so.19.1+0x26ce1)
#10 0x00007c43a4a2faae clang::ast_matchers::internal::DynTypedMatcher::matches(clang::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x5faae)
#11 0x00007c43a5527f67 clang::ast_matchers::internal::matcher_hasType1Matcher<clang::InitListExpr, clang::ast_matchers::internal::Matcher<clang::Decl>>::matches(clang::InitListExpr const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const (/opt/misc/llvm-19.1.7/bin/../lib/../lib/libclangTidyModernizeModule.so.19.1+0x1c0f67)
#12 0x00007c43a4a2fc6d clang::ast_matchers::internal::DynTypedMatcher::matchesNoKindCheck(clang::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x5fc6d)
#13 0x00007c43a4a2fe94 (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x5fe94)
#14 0x00007c43a4a332ec (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x632ec)
#15 0x00007c43a4a2faae clang::ast_matchers::internal::DynTypedMatcher::matches(clang::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x5faae)
#16 0x00007c43a6687f98 (/opt/misc/llvm-19.1.7/bin/../lib/../lib/libclangTidyAbseilModule.so.19.1+0x3df98)
#17 0x00007c43a4a2faae clang::ast_matchers::internal::DynTypedMatcher::matches(clang::DynTypedNode const&, clang::ast_matchers::internal::ASTMatchFinder*, clang::ast_matchers::internal::BoundNodesTreeBuilder*) const (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x5faae)
#18 0x00007c43a4a09302 (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x39302)
#19 0x00007c43a4a25506 (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x55506)
#20 0x00007c43a4a291ae (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x591ae)
#21 0x00007c43a4a29f43 (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x59f43)
#22 0x00007c43a4a219f8 (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x519f8)
#23 0x00007c43a4a21ada (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x51ada)
#24 0x00007c43a4a20491 (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x50491)
#25 0x00007c43a4a219f8 (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x519f8)
#26 0x00007c43a4a21ada (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x51ada)
#27 0x00007c43a4a29e00 (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x59e00)
#28 0x00007c43a4a219f8 (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x519f8)
#29 0x00007c43a4a21ada (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x51ada)
#30 0x00007c43a4a2a197 (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x5a197)
#31 0x00007c43a4a219f8 (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x519f8)
#32 0x00007c43a4a2dbf6 clang::ast_matchers::MatchFinder::matchAST(clang::ASTContext&) (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangASTMatchers.so.19.1+0x5dbf6)
#33 0x00007c43a27294d0 clang::MultiplexConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangFrontend.so.19.1+0x13e4d0)
#34 0x00007c439f653ccc clang::ParseAST(clang::Sema&, bool, bool) (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/../lib/libclangParse.so.19.1+0x39ccc)
#35 0x00007c43a26eb7f9 clang::FrontendAction::Execute() (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangFrontend.so.19.1+0x1007f9)
#36 0x00007c43a267370b clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/misc/llvm-19.1.7/bin/../lib/../lib/../lib/libclangFrontend.so.19.1+0x8870b)
#37 0x00007c43a4fe2cc4 clang::tooling::FrontendActionFactory::runInvocation(std::shared_ptr<clang::CompilerInvocation>, clang::FileManager*, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticConsumer*) (/opt/misc/llvm-19.1.7/bin/../lib/../lib/libclangTooling.so.19.1+0x5ecc4)
#38 0x00007c43a5025847 (/opt/misc/llvm-19.1.7/bin/../lib/../lib/libclangTidy.so.19.1+0x2d847)
#39 0x00007c43a4fdbb39 clang::tooling::ToolInvocation::runInvocation(char const*, clang::driver::Compilation*, std::shared_ptr<clang::CompilerInvocation>, std::shared_ptr<clang::PCHContainerOperations>) (/opt/misc/llvm-19.1.7/bin/../lib/../lib/libclangTooling.so.19.1+0x57b39)
#40 0x00007c43a4fde6b7 clang::tooling::ToolInvocation::run() (/opt/misc/llvm-19.1.7/bin/../lib/../lib/libclangTooling.so.19.1+0x5a6b7)
#41 0x00007c43a4fe0243 clang::tooling::ClangTool::run(clang::tooling::ToolAction*) (/opt/misc/llvm-19.1.7/bin/../lib/../lib/libclangTooling.so.19.1+0x5c243)
#42 0x00007c43a5026b4b clang::tidy::runClangTidy(clang::tidy::ClangTidyContext&, clang::tooling::CompilationDatabase const&, llvm::ArrayRef<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem>, bool, bool, llvm::StringRef) (/opt/misc/llvm-19.1.7/bin/../lib/../lib/libclangTidy.so.19.1+0x2eb4b)
#43 0x00007c43a672efbd clang::tidy::clangTidyMain(int, char const**) (/opt/misc/llvm-19.1.7/bin/../lib/libclangTidyMain.so.19.1+0xbfbd)
#44 0x00007c43a616f8a5 __libc_start_main (/lib64/libc.so.6+0x3a8a5)
#45 0x000000000040107e _start (/opt/misc/llvm-19.1.7/bin/clang-tidy+0x40107e)
The call_context.h:23:53, col:58 seems to refer to {impl} inside the following line
explicit CallContext(ConnectionImpl& impl) : _impl{impl} {}
where _impl is a private member of the CallContext class declared as ConnectionImpl& _impl;
Metadata
Metadata
Assignees
Labels
clang-tidycrashPrefer [crash-on-valid] or [crash-on-invalid]Prefer [crash-on-valid] or [crash-on-invalid]duplicateResolved as duplicateResolved as duplicate