Skip to content

clang 20: Sporadic crashes of clang-tidy check modernize-use-constraints #123726

@pkl97

Description

@pkl97

clang-tidy check modernize-use-constraints crashes sporadically (approximately in 5% of the runs) when given this program to analyze:

#include <boost/filesystem/path.hpp>

int main(int argc, char** argv)
{
    return EXIT_FAILURE;
}

boost/filesystem/path.hpp was taken from the current version Boost 1.87.0.

Script to run clang-tidy in a loop:

for i in {0001..1000}
do
    echo "Iteration $i"
    clang-tidy --extra-arg=-I/usr/local/clang20el9/include/c++/v1 --checks=-*,modernize-use-constraints --header-filter=^/home/user/devel/PROJECTS/.* -p /home/user/devel /home/user/devel/PROJECTS/FileWriter/UnityBuild.cpp
done

A dump of the crash:
ClangTidyCrash.txt

The last commit included in my clang 20 build from branch master is 106c483 from 2025-01-19.

The crash does not occur in clang-tidy 19 with the same Boost header file.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions