https://bugs.kde.org/show_bug.cgi?id=518098
Bug ID: 518098
Summary: Seg fault when running "clazy-compare-member-check"
Classification: Developer tools
Product: clazy
Version First unspecified
Reported In:
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: general
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Target Milestone: ---
SUMMARY
clang-tidy will seg fault when running the "clazy-compare-member-check" check
with ClazyClangTidy.so plugin loaded (introduced in 1.17).
STEPS TO REPRODUCE
1. main.cpp
#include <QApplication>
int main( int /*unused*/, char** const /*unused*/ )
{
}
2. CMakeLists.txt
cmake_minimum_required( VERSION 3.22 )
project( template-qt-project )
find_package( gentex-cmake 3.77 REQUIRED )
find_package(Qt6 REQUIRED COMPONENTS Core Widgets)
add_executable(template-qt-project main.cpp)
target_link_libraries(template-qt-project PRIVATE Qt6::Core Qt6::Widgets)
3. mkdir build && cd build
4. cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -G Ninja ..
5. cmake --build .
6. /usr/bin/clang-tidy -checks=clazy-compare-member-check -p=.
-load=ClazyClangTidy.so --warnings-as-errors=* /home/path/to/your/main.cpp
OBSERVED RESULT
Stack dump:
0. Program arguments: /usr/bin/clang-tidy
-checks=clazy-compare-member-check -p=. -load=ClazyClangTidy.so
--warnings-as-errors=*
/home/zachariahpifer/src/template-qt-project/src/main.cpp
1. <eof> parser at end of file
2. ASTMatcher: Processing '<unknown>' against:
CXXOperatorCallExpr :
</usr/bin/../lib/gcc/x86_64-redhat-linux/15/../../../../include/c++/15/bits/move.h:236:7,
col:13 <Spelling=line:198:45>>
--- Bound Nodes Begin ---
callExpr - { CXXOperatorCallExpr :
</usr/bin/../lib/gcc/x86_64-redhat-linux/15/../../../../include/c++/15/bits/move.h:236:7,
col:13 <Spelling=line:198:45>> }
--- Bound Nodes End ---
#0 0x00007f67c062917a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/lib64/libLLVM.so.20.1+0x22917a)
#1 0x00007f67c0626104 llvm::sys::RunSignalHandlers()
(/lib64/libLLVM.so.20.1+0x226104)
#2 0x00007f67c06298eb (/lib64/libLLVM.so.20.1+0x2298eb)
#3 0x00007f67bfe29040 __restore_rt (/lib64/libc.so.6+0x1a040)
#4 0x00007f67c96927c8 clang::Stmt::children()
(/lib64/libclang-cpp.so.20.1+0xa927c8)
#5 0x00007f67bf82138b
MemberCaller::run(clang::ast_matchers::MatchFinder::MatchResult const&)
(/usr/lib64/ClazyPlugin.so+0x2138b)
#6 0x00007f67c9956e39 (/lib64/libclang-cpp.so.20.1+0xd56e39)
#7 0x00007f67c99958fb
clang::ast_matchers::internal::BoundNodesTreeBuilder::visitMatches(clang::ast_matchers::internal::BoundNodesTreeBuilder::Visitor*)
(/lib64/libclang-cpp.so.20.1+0xd958fb)
#8 0x00007f67c9956633 (/lib64/libclang-cpp.so.20.1+0xd56633)
#9 0x00007f67c998a735 (/lib64/libclang-cpp.so.20.1+0xd8a735)
#10 0x00007f67c9968491 (/lib64/libclang-cpp.so.20.1+0xd68491)
#11 0x00007f67c999481d (/lib64/libclang-cpp.so.20.1+0xd9481d)
#12 0x00007f67c995b753 (/lib64/libclang-cpp.so.20.1+0xd5b753)
#13 0x00007f67c995881f (/lib64/libclang-cpp.so.20.1+0xd5881f)
#14 0x00007f67c995f4d0 (/lib64/libclang-cpp.so.20.1+0xd5f4d0)
#15 0x00007f67c995855f (/lib64/libclang-cpp.so.20.1+0xd5855f)
#16 0x00007f67c995ab8b (/lib64/libclang-cpp.so.20.1+0xd5ab8b)
#17 0x00007f67c995884f (/lib64/libclang-cpp.so.20.1+0xd5884f)
#18 0x00007f67c995905b (/lib64/libclang-cpp.so.20.1+0xd5905b)
#19 0x00007f67c995863f (/lib64/libclang-cpp.so.20.1+0xd5863f)
#20 0x00007f67c9958bab (/lib64/libclang-cpp.so.20.1+0xd58bab)
#21 0x00007f67c995843f (/lib64/libclang-cpp.so.20.1+0xd5843f)
#22 0x00007f67c991f879
clang::ast_matchers::MatchFinder::matchAST(clang::ASTContext&)
(/lib64/libclang-cpp.so.20.1+0xd1f879)
#23 0x00007f67cb55e2ec
clang::MultiplexConsumer::HandleTranslationUnit(clang::ASTContext&)
(/lib64/libclang-cpp.so.20.1+0x295e2ec)
#24 0x00007f67cb55e2ec
clang::MultiplexConsumer::HandleTranslationUnit(clang::ASTContext&)
(/lib64/libclang-cpp.so.20.1+0x295e2ec)
#25 0x00007f67c8e12d49 clang::ParseAST(clang::Sema&, bool, bool)
(/lib64/libclang-cpp.so.20.1+0x212d49)
#26 0x00007f67cb5191af clang::FrontendAction::Execute()
(/lib64/libclang-cpp.so.20.1+0x29191af)
#27 0x00007f67cb47ba24
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/lib64/libclang-cpp.so.20.1+0x287ba24)
#28 0x00007f67cb781285
clang::tooling::FrontendActionFactory::runInvocation(std::shared_ptr<clang::CompilerInvocation>,
clang::FileManager*, std::shared_ptr<clang::PCHContainerOperations>,
clang::DiagnosticConsumer*) (/lib64/libclang-cpp.so.20.1+0x2b81285)
#29 0x0000563cdf0ba1dc (/usr/bin/clang-tidy+0x72e1dc)
#30 0x00007f67cb780efa clang::tooling::ToolInvocation::runInvocation(char
const*, clang::driver::Compilation*,
std::shared_ptr<clang::CompilerInvocation>,
std::shared_ptr<clang::PCHContainerOperations>)
(/lib64/libclang-cpp.so.20.1+0x2b80efa)
#31 0x00007f67cb77f7a5 clang::tooling::ToolInvocation::run()
(/lib64/libclang-cpp.so.20.1+0x2b7f7a5)
#32 0x00007f67cb7833f1
clang::tooling::ClangTool::run(clang::tooling::ToolAction*)
(/lib64/libclang-cpp.so.20.1+0x2b833f1)
#33 0x0000563cdf0b356a
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) (/usr/bin/clang-tidy+0x72756a)
#34 0x0000563cde99a530 clang::tidy::clangTidyMain(int, char const**)
(/usr/bin/clang-tidy+0xe530)
#35 0x00007f67bfe12575 __libc_start_call_main (/lib64/libc.so.6+0x3575)
#36 0x00007f67bfe12628 __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3628)
#37 0x0000563cde997475 _start (/usr/bin/clang-tidy+0xb475)
Segmentation fault (core dumped)
EXPECTED RESULT
No seg fault
SOFTWARE/OS VERSIONS
Linux: Fedora 42
Qt Version: 6.10.2
ADDITIONAL INFORMATION
None
--
You are receiving this mail because:
You are watching all bug changes.