Live data from Hacker News

RipGrep musl binaries occasionally segfault during very-large searches

github.com

131–140 of 216 posts

Re: RipGrep musl binaries occasionally segfault during very-large searches

#131
post #79

Earlier quoted context omitted.

> But I really wish AI companies would spend more effort getting them to write in a neutral, concise way I wonder if this would make it harder or easier to detect whether the underlying meaning of the writing is bullshit.

Definitely easier. It's the same for humans. You can tell that someone has little of substance say when they cloak everything in big words and elaborate metaphors.

Good old sesquipedalian loquaciousness.

Re: RipGrep musl binaries occasionally segfault during very-large searches

#132
post #97
post #37

Earlier quoted context omitted.

Reading an AI-generated bug report is awful.

Maybe it's not going to get any better. LLMs were trained to do two things: - Mimic human language (and logic, since that's part of what we express with language). This includes code written by humans. - Write code to solve problems. The figure of merit here is solving the problem, not reproducing anything human. I'm not an expert on LLMs, but it's not obvious that the human reasoning they are fitting in the first ca…

A lot of it is that AI can talk with different "voice" but that requires giving it cues, and that costs money and expands context, so people that don't know, don't, and those that do have no incentive to

Re: RipGrep musl binaries occasionally segfault during very-large searches

#133
post #120

Earlier quoted context omitted.

The computer seems to have identified source code to blame though? Unless of course it hallucinated which there’s always a non zero chance of

It’s the kernel. Nothing a user space library can do should ever be able to call this. Just happens to be that the musl code is able to hit this and other code isn’t for some reason.

> It’s the kernel. Nothing a user space library can do should ever be able to call this.

I don't follow. An application might see this kind of crash if it has a bug causing it to access a page while another thread is mapping or unmapping that page. That would be a bug in mallocng, musl or ripgrep. Or, as someone else mentioned, it could be bug in the processor's virtual memory logic that has the same effect. Why do you say it can only be a kernel bug?

Re: RipGrep musl binaries occasionally segfault during very-large searches

#134
post #5

Earlier quoted context omitted.

I can read it but not sure if worth spending energy on it. It doesn't make sense for the reader to spend more energy than the writer spent on creating it.

> It doesn't make sense for the reader to spend more energy than the writer spent on creating it. Great way to summarize cultural "economics" Couldn't put the words on this pattern but sometimes all I care about is that someone cared about.

I usually go for "If I wanted LLM answer I'd ask LLM instead of reading your answer/article/content"

Re: RipGrep musl binaries occasionally segfault during very-large searches

#135
post #118
post #99

Earlier quoted context omitted.

So the theory is that the page is faulted in, then somehow evicted within 10 instructions, then re-faulted in somewhere else, resulting in writes not making it to the page? That would need a context switch and another page fault to happen in short succession. But the context switch to evict the page back out would have necessitated pending writes to have finished. Nothing actually makes sense with that explanation.

Sounded like a race condition causing a correct new mapping in the TLB to be cleared away by mistake, reverting back to the zero page mapping it was before.

Except incorrectly flushing the TLB would merely be a performance bug.

Re: RipGrep musl binaries occasionally segfault during very-large searches

#136

Earlier quoted context omitted.

I don't care if the cat is black or white, so long as it catches mice. Translation: if this nails-on-chalkboard LLM spew identifies a kernel bug, which is then patched, its aesthetic qualities do not interest me in the slightest.

Unfortunately, the kernel bug would need to be understood to be patched, and the developed patch itself would need to be reviewed before being accepted, which seems... very hard, to put it mildly, using the nails-on-chalkboard LLM spew report.

At least it is a report. It says hey, there's a bug vaguely like this in this general area. Not too dissimilar from the average user report.

Re: RipGrep musl binaries occasionally segfault during very-large searches

#137
post #120

Earlier quoted context omitted.

The computer seems to have identified source code to blame though? Unless of course it hallucinated which there’s always a non zero chance of

It’s the kernel. Nothing a user space library can do should ever be able to call this. Just happens to be that the musl code is able to hit this and other code isn’t for some reason.

User code calls kernel code all the time - just not by its address.

Re: RipGrep musl binaries occasionally segfault during very-large searches

#138

Earlier quoted context omitted.

Rust doesn't get to override musl internals. Ripgrep uses opendir, a POSIX library feature implemented in musl to look at er, directories. The stack trace suggests we blew up when Rust's std::sys::fs::unix::readdir internal detail called opendir, and it in turn allocated. On Linux it would be possible for ripgrep to talk directly to the kernel via documented system calls without libc, but that wouldn't work on any ot…

I assume it already doesn't work on Windows. At some point you have to define your compatibility boundary. And high performance often coincides with mediocre compatibility.

A good example is go. On linux you can use a from scratch image fairly easily because it only uses syscalls. But for windows or mac the moving target wasn't maintainable so they link against shared objects. Linus enforcing the don't break userspace rule is what made that possible. That definitely has tradeoffs. At some point relibc or something similar will allow the same (stably) for rust. But using posix as that compatibility boundary gets you a much larger set of OS and only occasionally has a performance penalty. Often, a posix api tuned to the kernel is more performant. Musl is an exception precisely because it makes an openbsd-esque trade of performance for simple small attack surface.

Re: RipGrep musl binaries occasionally segfault during very-large searches

#139
post #101
post #80

Earlier quoted context omitted.

Exactly, it would be so much better if they shared the prompts instead of the output, at least then we'd be able to make some sense of what they were thinking about.

Unfortunately the prompt may have been something like "investigate this bug and file an issue when you think you understand what's going on". The "better just to share the prompt" heuristic falls down when the actual underlying intellectual work was also done by the machine. (Feel free to pretend that I used some phrase other than "intellectual work" if you dislike seeing it used to describe something done by AI.)

How so? We can give the same starting point to the same AI and ask it to investigate too.
Post reply on HN