Skip to content

clang-format reproducible crash #145380

Closed
Closed
@mathcounts4

Description

@mathcounts4

This consistently causes clang-format 19.1.7 to crash:
clang-format myfile.hpp
with no _clang-format file

myfile.hpp:

#pragma once

template<class Vec>
bool isInit(Vec const& vec, std::size_t i) {
    return vec.isInit(i);
}

template <class Vec>
bool isInit(Vec const& vec, std::size_t i)
requires(requires() { is_initialized
{
    return vec.is_initialized(i);
}

Windows stack trace:

C:\Users\dfern\clang-format-bugs\2025_06_23_crash>clang-format myfile.hpp
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: clang-format myfile.hpp
Exception Code: 0xC0000005
0x00007FF6FE45CA6C, C:\Users\dfern\AppData\Local\Microsoft\WinGet\Packages\LLVM.ClangFormat_Microsoft.Winget.Source_8wekyb3d8bbwe\clang-format.exe(0x00007FF6FE360000) + 0xFCA6C byte(s)
0x00007FF6FE45C6C0, C:\Users\dfern\AppData\Local\Microsoft\WinGet\Packages\LLVM.ClangFormat_Microsoft.Winget.Source_8wekyb3d8bbwe\clang-format.exe(0x00007FF6FE360000) + 0xFC6C0 byte(s)
0x00007FF6FE45DA1D, C:\Users\dfern\AppData\Local\Microsoft\WinGet\Packages\LLVM.ClangFormat_Microsoft.Winget.Source_8wekyb3d8bbwe\clang-format.exe(0x00007FF6FE360000) + 0xFDA1D byte(s)
0x00007FF6FE459BE7, C:\Users\dfern\AppData\Local\Microsoft\WinGet\Packages\LLVM.ClangFormat_Microsoft.Winget.Source_8wekyb3d8bbwe\clang-format.exe(0x00007FF6FE360000) + 0xF9BE7 byte(s)
0x00007FF6FE4584BC, C:\Users\dfern\AppData\Local\Microsoft\WinGet\Packages\LLVM.ClangFormat_Microsoft.Winget.Source_8wekyb3d8bbwe\clang-format.exe(0x00007FF6FE360000) + 0xF84BC byte(s)
0x00007FF6FE456B62, C:\Users\dfern\AppData\Local\Microsoft\WinGet\Packages\LLVM.ClangFormat_Microsoft.Winget.Source_8wekyb3d8bbwe\clang-format.exe(0x00007FF6FE360000) + 0xF6B62 byte(s)
0x00007FF6FE41D62E, C:\Users\dfern\AppData\Local\Microsoft\WinGet\Packages\LLVM.ClangFormat_Microsoft.Winget.Source_8wekyb3d8bbwe\clang-format.exe(0x00007FF6FE360000) + 0xBD62E byte(s)
0x00007FF6FE3F5020, C:\Users\dfern\AppData\Local\Microsoft\WinGet\Packages\LLVM.ClangFormat_Microsoft.Winget.Source_8wekyb3d8bbwe\clang-format.exe(0x00007FF6FE360000) + 0x95020 byte(s)
0x00007FF6FE401CC4, C:\Users\dfern\AppData\Local\Microsoft\WinGet\Packages\LLVM.ClangFormat_Microsoft.Winget.Source_8wekyb3d8bbwe\clang-format.exe(0x00007FF6FE360000) + 0xA1CC4 byte(s)
0x00007FF6FE400ADB, C:\Users\dfern\AppData\Local\Microsoft\WinGet\Packages\LLVM.ClangFormat_Microsoft.Winget.Source_8wekyb3d8bbwe\clang-format.exe(0x00007FF6FE360000) + 0xA0ADB byte(s)
0x00007FF6FE36D727, C:\Users\dfern\AppData\Local\Microsoft\WinGet\Packages\LLVM.ClangFormat_Microsoft.Winget.Source_8wekyb3d8bbwe\clang-format.exe(0x00007FF6FE360000) + 0xD727 byte(s)
0x00007FF6FE371275, C:\Users\dfern\AppData\Local\Microsoft\WinGet\Packages\LLVM.ClangFormat_Microsoft.Winget.Source_8wekyb3d8bbwe\clang-format.exe(0x00007FF6FE360000) + 0x11275 byte(s)
0x00007FF6FE4E3FA0, C:\Users\dfern\AppData\Local\Microsoft\WinGet\Packages\LLVM.ClangFormat_Microsoft.Winget.Source_8wekyb3d8bbwe\clang-format.exe(0x00007FF6FE360000) + 0x183FA0 byte(s)
0x00007FFF96BA259D, C:\Windows\System32\KERNEL32.DLL(0x00007FFF96B90000) + 0x1259D byte(s), BaseThreadInitThunk() + 0x1D byte(s)
0x00007FFF9774AF58, C:\Windows\SYSTEM32\ntdll.dll(0x00007FFF976F0000) + 0x5AF58 byte(s), RtlUserThreadStart() + 0x28 byte(s)

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang-formatcrashPrefer [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