A rare bug in ripgrep's musl builds causes crashes on massive codebases

A rare bug in ripgrep's musl builds causes crashes on massive codebases

If you run statically linked ripgrep binaries on massive codebases, your search might randomly crash.

A report in the ripgrep repository revealed that version 15.2.0 built against musl-libc occasionally segfaults during high-concurrency directory walks. The crash hits an integrity assertion inside musl's allocator (mallocng) during an opendir call. A developer reproduced the bug on OpenSUSE Tumbleweed while running a continuous search across 1.8 million files—roughly 20GiB of data—on a 24-core system.

Why it matters: Static musl binaries are the default choice for shipping portable Linux command-line tools that run anywhere. Spotting memory corruption under heavy multi-threaded file scans shows how tricky interactions between directory traversal and alternative C standard libraries can be at scale.

Know this: The bug was originally noticed in the binary bundled with OpenAI Codex, but it reproduces on official standalone x86_64-unknown-linux-musl releases. Standard GNU libc builds do not hit this specific musl allocator check.

Even the fastest file-search tool in tech occasionally trips over a C library memory assertion.