logoalt Hacker News

RipGrep musl binaries occasionally segfault during very-large searches

85 pointsby throwaway2037today at 12:34 PM42 commentsview on HN

Comments

Orphistoday at 2:09 PM

I get why people don't bother replacing the default allocator from musl all the time (it's there, convenient). But in an application whose purpose is to be FAST, I find it weird they haven't bothered replacing it with another more performant one.

mallocng is bad at dealing with contention during multithreading. I've had applications that usually were I/O bound suddenly become "malloc" bound when building with musl in multithreaded scenarios (and only just 8 threads). Switching to mimalloc improved performance by 20x, very close to what glibc offers by default, and just a bit under a glibc + mimalloc configuration.

I get that there's a real issue there and it's interesting (to some) to address it, but it should have never surfaced this way in the first place.

hyperpapetoday at 12:44 PM

The analysis of the kernel bug may be a better thing to link to: https://github.com/dfoxfranke/ripgrep-3494-analysis.

show 6 replies
est31today at 2:19 PM

It's never a kernel bug... until it is!

villgaxtoday at 2:02 PM

No wonder search in codex is so a$$

sligortoday at 12:52 PM

So, why the bug triggers only with muslc and not other libc ?

sr0b0ttoday at 1:24 PM

[dead]

walk12111today at 12:56 PM

[dead]

rainmakingtoday at 1:12 PM

[flagged]

wild_pointertoday at 12:43 PM

wow, everything is broken lol

shevy-javatoday at 2:08 PM

This is a bit sad. Here we have an example of rust and musl struggling whereas C/C++ and glibc does not. That's an oversimplification, but we also had not long ago the rewrite of ... I believe it was coreutils, in rust (or was it utillinux ... but I think it was coreutils), also have issues. Rust needs to toughen up here when it really wants to replace all of C in the linux ecosystem. Alternatively it could admit failure, then people can say that C will be - and remain - the forever king.

show 2 replies