Skip to content

clang-format-20 was terminated by OOM-killer while formatting large c-header #168317

@FirelessWidelity

Description

@FirelessWidelity

system and version:

$ clang-format --version
Ubuntu clang-format version 20.1.8 (++20250708082409+6fb913d3e2ec-1~exp1~20250708202428.132)

$ uname -a
Linux tester 6.8.0-87-generic #88~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Oct 14 14:03:14 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

file size:

$ ls -lah ./drv_cfg.h
-rwxrwxr-x 1 tester tester 141K nov 17 12:43 ./drv_cfg.h

Memory usage increases every second until the system finally freezes/crashes:

$ while :; do ps -aux | rg clang-format ; sleep 1; clear; done
tester       6106  101 75.8 14380988 12239548 pts/0 R+ 12:46   0:20 clang-format-20 -verbose -i ./drv_cfg.h

The "-verbose" flag does not output errors to the console when formatting this file.

Can you make patch for 20th version of clang-format to fix this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions