RipGrep musl binaries occasionally segfault during very-large searches
- Programming
- Infrastructure
- Open Source
- AI
- Hardware
The GitHub issue reported intermittent segfaults in ripgrep's musl binary when searching extremely large directory trees. The failure showed up in directory traversal rather than regex matching, with stack traces pointing at musl's `opendir` path. That sent people down two tracks. First, the likely technical cause. The consensus landed on a Linux memory management bug, not a ripgrep logic bug. Musl appears to make the race easier to hit because its allocator and libc code expose a pattern of freshly faulted pages and frequent `munmap` activity that narrows the timing enough to trip a kernel edge case. Several commenters stressed that ripgrep already uses jemalloc for Rust allocations on 64-bit musl, so the remaining musl allocations come from libc internals that Rust's global allocator override cannot replace.
If you ship musl-based static binaries, do not treat rare crashes as automatically being your app's fault or musl's fault. Reproduce across kernels and hardware, and separate the value of a reproducer from the trustworthiness of any AI-written root-cause analysis attached to it.
-
github.com
- Discuss on HN