Skip to content

zig fmt freeze and memory leak #23722

@xor-bits

Description

@xor-bits

Zig Version

0.15.0-dev.386+2e35fdd03

Steps to Reproduce and Observed Behavior

run zig fmt main.zig on:

// main.zig
fn main() void {
    asm volatile (
        \\
        ++ ""
        :
        : [args] "r" (args),
    );
}

The formatter hangs and starts leaking memory until OOM killer kills it or you kill it manually

The compiler itself is fine with it (not this minimal reproducible example) but the formatter specifically isn't. Example where the code compiles but the formatter crashes: link.

Also happens on 0.14.0

Expected Behavior

The formatter should format the file like normal and exit

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorzig fmt

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions