Skip to content

[clang-tidy] altera-id-dependent-backward-branch crash #55408

@hakjo666

Description

@hakjo666

System Info

Program: clang-tidy
Version: 13.0.1 and 14.0.0
Platform: Red Hat Enterprise Linux release 8.6 (Ootpa)

Description

We run clang-tidy as part a sonar job in a Jenkins server.
This job randomly fails because clang-tidy crashes. This has been the case since quite a while back.

Recently we upgraded from clang 11 (unknown patch version) to 13.0.1
Before the crash was quite rare and not reproducible. Which files it crashed on is random.
Now it crashed every time on some files.
I will dig into that code and see if I can create a minimal test case for you.

Stacktrace

PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0.	Program arguments: clang-tidy --use-color -p=<*snip*>
1.	<eof> parser at end of file
 #0 0x00007fe74c02ef00 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/lib64/libLLVM-13.so+0xae3f00)
 #1 0x00007fe74c02cae4 llvm::sys::RunSignalHandlers() (/lib64/libLLVM-13.so+0xae1ae4)
 #2 0x00007fe74c02d615 (/lib64/libLLVM-13.so+0xae2615)
 #3 0x00007fe754a77ce0 __restore_rt (/lib64/libpthread.so.0+0x12ce0)
 #4 0x000055ca1ab5a1d3 (/usr/bin/clang-tidy+0x1191d3)
 #5 0x000055ca1ab5a0f5 (/usr/bin/clang-tidy+0x1190f5)
 #6 0x000055ca1ab5a278 (/usr/bin/clang-tidy+0x119278)
 #7 0x000055ca1ab5a0f5 (/usr/bin/clang-tidy+0x1190f5)
 #8 0x000055ca1ab5a278 (/usr/bin/clang-tidy+0x119278)
 #9 0x000055ca1ab5a0f5 (/usr/bin/clang-tidy+0x1190f5)
#10 0x000055ca1ab5a278 (/usr/bin/clang-tidy+0x119278)
#11 0x000055ca1ab5a0f5 (/usr/bin/clang-tidy+0x1190f5)
#12 0x000055ca1ab5faf1 (/usr/bin/clang-tidy+0x11eaf1)
#13 0x00007fe7520737f9 (/lib64/libclang-cpp.so.13+0x12057f9)
#14 0x00007fe7520b38cc clang::ast_matchers::internal::BoundNodesTreeBuilder::visitMatches(clang::ast_matchers::internal::BoundNodesTreeBuilder::Visitor*) (/lib64/libclang-cpp.so.13+0x12458cc)
#15 0x00007fe7520762b0 (/lib64/libclang-cpp.so.13+0x12082b0)
#16 0x00007fe75209a30c (/lib64/libclang-cpp.so.13+0x122c30c)
#17 0x00007fe7520ab9de (/lib64/libclang-cpp.so.13+0x123d9de)
#18 0x00007fe7520993e5 (/lib64/libclang-cpp.so.13+0x122b3e5)
#19 0x00007fe75209a9c0 (/lib64/libclang-cpp.so.13+0x122c9c0)
#20 0x00007fe7520af262 (/lib64/libclang-cpp.so.13+0x1241262)
#21 0x00007fe752096086 (/lib64/libclang-cpp.so.13+0x1228086)
#22 0x00007fe752096fbd (/lib64/libclang-cpp.so.13+0x1228fbd)
#23 0x00007fe7520adc7c (/lib64/libclang-cpp.so.13+0x123fc7c)
#24 0x00007fe752096fbd (/lib64/libclang-cpp.so.13+0x1228fbd)
#25 0x00007fe752097a31 (/lib64/libclang-cpp.so.13+0x1229a31)
#26 0x00007fe7520964cd (/lib64/libclang-cpp.so.13+0x12284cd)
#27 0x00007fe752096fbd (/lib64/libclang-cpp.so.13+0x1228fbd)
#28 0x00007fe752097a31 (/lib64/libclang-cpp.so.13+0x1229a31)
#29 0x00007fe7520964cd (/lib64/libclang-cpp.so.13+0x12284cd)
#30 0x00007fe752096fbd (/lib64/libclang-cpp.so.13+0x1228fbd)
#31 0x00007fe752097a31 (/lib64/libclang-cpp.so.13+0x1229a31)
#32 0x00007fe7520ae59c (/lib64/libclang-cpp.so.13+0x124059c)
#33 0x00007fe752096fbd (/lib64/libclang-cpp.so.13+0x1228fbd)
#34 0x00007fe752097243 clang::ast_matchers::MatchFinder::matchAST(clang::ASTContext&) (/lib64/libclang-cpp.so.13+0x1229243)
#35 0x00007fe753404270 clang::MultiplexConsumer::HandleTranslationUnit(clang::ASTContext&) (/lib64/libclang-cpp.so.13+0x2596270)
#36 0x00007fe751a893a9 clang::ParseAST(clang::Sema&, bool, bool) (/lib64/libclang-cpp.so.13+0xc1b3a9)
#37 0x00007fe7533d1841 clang::FrontendAction::Execute() (/lib64/libclang-cpp.so.13+0x2563841)
#38 0x00007fe75336d2ab clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/lib64/libclang-cpp.so.13+0x24ff2ab)
#39 0x00007fe7535ef880 clang::tooling::FrontendActionFactory::runInvocation(std::shared_ptr<clang::CompilerInvocation>, clang::FileManager*, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticConsumer*) (/lib64/libclang-cpp.so.13+0x2781880)
#40 0x000055ca1b01d3b2 (/usr/bin/clang-tidy+0x5dc3b2)
#41 0x00007fe7535e86a6 clang::tooling::ToolInvocation::runInvocation(char const*, clang::driver::Compilation*, std::shared_ptr<clang::CompilerInvocation>, std::shared_ptr<clang::PCHContainerOperations>) (/lib64/libclang-cpp.so.13+0x277a6a6)
#42 0x00007fe7535eb158 clang::tooling::ToolInvocation::run() (/lib64/libclang-cpp.so.13+0x277d158)
#43 0x00007fe7535ee05c clang::tooling::ClangTool::run(clang::tooling::ToolAction*) (/lib64/libclang-cpp.so.13+0x278005c)
#44 0x000055ca1b01e7fa (/usr/bin/clang-tidy+0x5dd7fa)
#45 0x000055ca1aaf931b (/usr/bin/clang-tidy+0xb831b)
#46 0x00007fe74a891ca3 __libc_start_main (/lib64/libc.so.6+0x3aca3)
#47 0x000055ca1aaeff4e (/usr/bin/clang-tidy+0xaef4e)
<*snip*>: terminated by signal 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang-tidycrashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions