News for hackers. Stuff that matters.
Re:Bugs Rust Won't Catch by slopinthebag on Wednesday April 29, 2026 @01:14AM (#47944411)
Seems pretty impressive they rewrote the coreutils in a new language, with so little Unix experience, and managed to do such a good job with very little bugs or vulns. I would have expected an order of magnitude more at least.

Shows how good Rust is, that even inexperienced Unix devs can write stuff like this and make almost no mistakes.

Re:Bugs Rust Won't Catch by nine_k on Wednesday April 29, 2026 @01:26AM (#47944491)
Yes, it's the lack of Unix experience that's terrifying. So many of mistakes listed are rookie mistakes, like not propagating the most severe errors, or the `kill -1` thing. Why were people who apparently did not have much experience using coreutils assigned to rewrite coreutils?
Re:Bugs Rust Won't Catch by aw1621107 on Wednesday April 29, 2026 @01:48AM (#47944606)
> Why were people who apparently did not have much experience using coreutils assigned to rewrite coreutils?

From what I understand, "assigned" probably isn't the best way to put it. uutils started off back in 2013 as a way to learn Rust [0] way before the present kerfuffle.

[0]: https://github.com/uutils/coreutils/tree/9653ed81a2fbf393f42...

Re:Bugs Rust Won't Catch by nineteen999 on Wednesday April 29, 2026 @02:15AM (#47944746)
Yeah perhaps learning UNIX API's and Rust at the same time doesn't lead to a drop in replacement ready to be shipped in major distributions. Who whould have thunk it.
Re:Bugs Rust Won't Catch by aw1621107 on Wednesday April 29, 2026 @05:26AM (#47945996)
Strictly speaking it doesn't preclude eventually producing a production-ready drop-in replacement either, though evidently that needs a fresh set of eyes.
Re:Bugs Rust Won't Catch by bpbp-mango on Wednesday April 29, 2026 @02:38AM (#47944861)
exactly this. I wrote one of them back then as a learning experience. some of the code I wrote is still intact, incredibly.
Re:Bugs Rust Won't Catch by JuniperMesos on Wednesday April 29, 2026 @02:07AM (#47944704)
Why is it even possible to represent a negative PID, let alone treat the integer -1 as a PID meaning "all effective processes"? This seems like a mistake (if not a rookie mistake) in the Linux kernel API itself.
Re:Bugs Rust Won't Catch by nine_k on Wednesday April 29, 2026 @03:33AM (#47945210)
-1 is a special case, a way to represent a PID with all bits set in a platform-independent way. It's not very clean, and it comes from ancient times when writing some extra code and storing an extra few bytes was way more expensive.
Re:Bugs Rust Won't Catch by bonzini on Wednesday April 29, 2026 @06:42AM (#47946471)
No, -1 is simply the process group with pgid 1:

https://stackoverflow.com/questions/392022/whats-the-best-wa...

The problem is that -DIGIT doubles as both "signal number" and process group. The right way to invoke kill for a process group however would be "kill [OPTS]... -- -PGID".

Re:Bugs Rust Won't Catch by dminik on Wednesday April 29, 2026 @03:34AM (#47945213)
It feels a bit like a "better is better" language hitting all of the quirks of a "worse is better" environment.
Re:Bugs Rust Won't Catch by antonvs on Wednesday April 29, 2026 @03:26AM (#47945165)
Pretty much all the rough edges being discussed here are design mistakes in Linux or Unix, and/or a consequence of using an unsafe language with limited abstractions and a weak type system. But because of ubiquity, this is everyone’s problem now.
Re:Bugs Rust Won't Catch by adrian_b on Wednesday April 29, 2026 @06:15AM (#47946292)
You are right, but those who set for themselves the goal to substitute a Linux/UNIX package must implement programs that handle correctly all the quirks of the existing Linux/POSIX specifications.

If they do not like the design mistakes, great, they should set for themselves the goal to write a new operating system together with all base applications, where all these mistakes are corrected.

As long as they have not chosen the second goal, but the first, they are constrained by the existing interfaces and they must use them correctly, no matter how inconvenient that may be.

Anyone who learns English may be frustrated by many design mistakes of English, but they must still use English as it is spoken by the natives, otherwise they will not be understood.

Re:Bugs Rust Won't Catch by gblargg on Wednesday April 29, 2026 @03:53AM (#47945334)
Rewriting perfectly good code was a colossal mistake.
Re:Bugs Rust Won't Catch by Cthulhu_ on Wednesday April 29, 2026 @05:25AM (#47945987)
Not necessarily, but was the reasoning sound and have the tradeoffs been made? The website (https://uutils.github.io/) shows some reasonable "why"s (although I disagree with making "Rust is more appealing" a compelling reason, but that's just me (disclaimer: I don't like C and don't know Rust so take this comment as you will)), but I think what's missing is how they will ensure both compatibility and security / edge case handling, which requires deep knowledge and experience in the original code and "tribal knowledge" of deep *nix internals.
Re:Bugs Rust Won't Catch by dwattttt on Wednesday April 29, 2026 @05:48AM (#47946148)
I do wonder whether people got down the article enough to see the list of bugs patched in GNU coreutils.

That "perfectly good code" that it sounds like no one should question included "split --line-bytes has a user controlled heap buffer overflow".

Re:Bugs Rust Won't Catch by gblargg on Wednesday April 29, 2026 @08:29AM (#47947414)
Yes, perfectly good code can have bugs. This is ridiculous thinking to scrap a codebase because it's not bug-free, to replace it with one riddled with differences in behavior that break everything that uses it.
Re:Bugs Rust Won't Catch by kibwen on Wednesday April 29, 2026 @09:36AM (#47948281)
The irony here being that GNU's coreutils themselves originated as rewrites, from back when BSD's copyright status was still legally unclear.
Re:Bugs Rust Won't Catch by gblargg on Wednesday April 29, 2026 @10:47AM (#47949200)
Understandable as GNU was founded on software freedom. I guess one could argue that the Rust rewrite is to establish some kind of higher standard for correctness.