HNHacker News
TopNewBestAskShowJobs

collinfunk

647 karma · joined December 8, 2023

submissionscomments
collinfunk··on Ubuntu 26.10 completes transition to Rust-based coreutils
I really don't understand why Canonical rushes this. If 'rm' can't remove all possible directory entries, that is a big issue:

  $ podman run --rm -it ubuntu:26.10
  $ apt update -y; apt upgrade -y
  $ rm --version
  rm (uutils coreutils) 0.10.0
  $ gnumkdir -p $(yes a/ | head -n $((32 * 1024)) | tr -d '\n')
  $ rm -rf a
  Segmentation fault (core dumped) rm -rf a
  $ ls a
  a
  $ gnurm -rf a
  $ ls a
  ls: cannot access 'a': No such file or directory
collinfunk··on Sovereign Tech Agency invests €500k in Flatpak
Note that STF did not fund GNU coreutils. They funded uutils.
collinfunk··on Rewriting in Rust
> Is there any effort from the GNU organization to solve long-standing issues and pain points such as locales?

Most GNU projects don't have a large overlap, if any overlap at all, between their active contributors. I suspect they behave far more independently than you expect. Also, GNU didn't invent locales, if that is what you are getting at.

> As it stands I am generally averse to using GNU tools because my feeling is that they will be slow, clunky and exhibit arcane behavior in particular edge cases. ripgrep is significantly faster than GNU grep -R; fd than GNU find, etc.

Those programs have their imperfections as well. Particularly, they don't account for arbitrary limits like PATH_MAX. See 'fd' stops before visiting the deepest directory without altering it's exit code:

  $ mkdir -p $(yes a/ | head -n $((16 * 1024)) | tr -d '\n')
  $ fd a | wc -l
  3119
  $ echo ${PIPESTATUS[@]}
  0 0
On the other hand GNU find can visit arbitrarily deep directories:

  $ find a | wc -l
  16384
ripgrep has similar issues:

  $ (while cd $(yes a/ | head -n 1024 |  tr -d '\n'); do :; done > /dev/null 2>&1; echo a > a)
  $ rg '^a$' a
  rg: a/[...]/a: File name too long (os error 36)
GNU grep handles this fine:

  $ grep -r '^a$' a
  a/[...]/a:a

> For example, before LLMs were common, I once had to spend an entire day getting GNU flex and GNU bison to generate code that was: a) properly prefixed with a custom prefix, not yy_ et. al and b) did not use global variables.

Flex isn't a GNU project. I don't use or contribute to Bison, but I am pretty sure that is here:

https://www.gnu.org/software/bison/manual/bison.html#Multipl...

> I would have understood if, for backwards compatibility, this was gated behind a --sane flag or similar, but the GNU manuals were, at least at the time, under the confusing impression that what I was doing was advanced usage and used semi-fancy terms like "re-enterant" to describe what should be the normal behavior. I had to toggle several different knobs, some working for macros, others for functions, and the knobs were different for flex and bison.

Again, I don't contribute to Flex or Bison. I also do not use them. However, I will note that understanding the programs require some complex topics, specifically formal languages and automata. I am not entirely surprised that some of the documentation can be a bit difficult to understand.

> POSIX locales in particular are an anti-feature, and I say this as a non-English native, so uutils adding support for them feels like bug-compatibility with GNU, not feature-compatibility.

They are also widely supported by other implementations. It would be harmful to everyone if we were to disregard them. Also, as I mentioned previously, they were not invented by GNU.

> Other issues involve the dynamic linking requirements of glibc and of the nsswitch in a world that would increasingly prefer to link things statically.

I am a committer to glibc, but this isn't really my area of focus. You are free to discuss it on libc-help@sourceware.org if you'd like.

> I am really saddened if the reaction is just that GNU is the old and stable is the main argument here. Because when you read many GNU documents and manpages, written years ago, you get the feeling that the original authors were looking to do things properly, make breaking changes where they were sane (hence POSIXLY_CORRECT), innovate (Emacs), and overall would not have been particularly swayed by the "old and stable" argument of traditional Unix distributions at the time.

We make breaking changes. I recently changed 'printenv' and 'env' to safely quote their output. I will note though that although you want us to make more changes like this, others get quite angry at us when we do. Even changes that aren't breaking cause angry mailing list messages. We can't make everyone happy.

> Can GNU programs innovate?

Individual GNU projects are free to innovate as much or as little as they want.

collinfunk··on Rewriting in Rust
Note, I am a co-maintainer of GNU coreutils. Whether that makes my opinion relevant, biased, or both, you can decide. :)

I really wished the documented their benchmarking methodology here, or at least cautioned the reader not to jump to conclusions based on the benchmarks shown.

GNU 'sort' performance can drastically be altered by the locale in use, the input, and the arguments given to the --buffer-size and --parallel options. GNU 'sort' is fairly conservative in how many threads it will use by default, and in my experience, much more so than uutils. This is because throwing more threads at 'sort' may make it faster (or may not), but also risks running out of memory. This is an issue with uutils, which is poor at deciding when to use external sorting:

  $ export LC_ALL=C
  $ for i in {a..z}; do yes $i | head -n $(numfmt --from=iec 512M) | tr -d '\n' >> input; done
  $ time sort input > /dev/null

  real 0m24.245s
  user 0m0.896s
  sys 0m19.161s
Here is the same command using the latest uutils commit compiled with 'make PROFILE=release':

  $ time uu-sort input > /dev/null
  Killed                     uu-sort input > /dev/null

  real 2m53.560s
  user 1m40.634s
  sys 0m59.847s
The process gets killed by the OOM killer. This is likely because uutils 'sort' decides to use 18 threads, instead of the 1 used by GNU 'sort'. I find it a bit frustrating that benchmarks are thrown out without any methodology or citations, because they are often trusted without question. These could be benchmarks from before uutils had localization, which was the case before 2025, and treated LC_ALL=en_US.UTF-8 as LC_ALL=C. In that case, of course it would be much faster than GNU coreutils, but it also means uutils would give you the wrong results for non-ASCII characters. There is, as shown above, much more considerations beyond speed that seemingly never get the time of day next to flashy benchmarks...
collinfunk··on How the FSF sysadmins block botnets with reaction
When did this occur? I am a GNU maintainer, and have never heard such a thing from the FSF. The GNU Coding Standards and other similar texts leave the decision to support non-free platforms up to the maintainer.
collinfunk··on Show HN: A wc rewrite in Rust that makes it over 100 times faster
I co-maintain GNU coreutils and wrote the Neon 'wc -l' code, for reference.

Based on my quick look at the source code, it looks like this program can handle ASCII whitespace. GNU coreutils uses iswspace, which is locale-aware. That limits how much we can optimize. We could probably add more optimization if the current locale is ASCII, e.g., LC_ALL=C on GNU/Linux.

collinfunk··on OpenBSD has a use-after-free allowing local privilege escalation to root
The others and I, working on GNU coreutils, frequently use 'yes' to generate a bunch of garbage input for testing programs. It is nice that it can do so quickly.
collinfunk··on Honesty gets Emacs patch rejected
The author states that they are not a lawyer, which is all good and okay. However, immediately afterwards they seem to claim that they know the law better than GNU, the FSF, and their lawyers. It confuses me how the author does not see that as a problem.
collinfunk··on DNI Gabbard Reveals Evidence of U.S. Taxpayer-Funded Global Biolab Program
> Why would you mention the labs in connection to a question specifically about bio weapons?

Which situation do you think looks worse, admitting to having biological research facilities (unrelated to weaponry), or having Russians invade, take over one of said research facilities, and run with whatever story they want to justify their war?

collinfunk··on DNI Gabbard Reveals Evidence of U.S. Taxpayer-Funded Global Biolab Program
> is it really that big of a jump to connect gain of function research and bioweaponry?

Have you seen any evidence for the bio-weaponry claim?

> to be fair the world genuinely believes COVID spontaneously manifested directly next to a US funded COVID research site, so perhaps the gap is really that wide.

You would need more evidence than proximity to prove that.

collinfunk··on DNI Gabbard Reveals Evidence of U.S. Taxpayer-Funded Global Biolab Program
The whole "biolab" thing is pretty common Russian propaganda [1]. Unsurprising to hear Gabbard parroting it yet again.

[1] https://en.wikipedia.org/wiki/Ukraine_bioweapons_conspiracy_...

collinfunk··on Why Gentoo?
Well, they have held back some slop in CPAN (a surprising place to find slop) [1]. Some of said slop recently caused GNU coreutils test suite to fail [2]. Surely the bot will get it right one day, right?

[1] https://bugs.gentoo.org/971488 [2] https://github.com/cpan-authors/IO-Tty/issues/91

collinfunk··on Disabling the new AF_ALG by default in gnulib (from 2018)
This came up again recently when I added SHA-3 support to 'cksum'. I think the conclusion was that OpenSSL was still faster. All of Assaf's points are good too, though.
collinfunk··on Bugs Rust won't catch
At the current moment I would be against it. The language and library is changing too fast. Also, Rust has some other things that make it hard to use for coreutils. For example, Rust programs always call signal (SIGPIPE, SIG_IGN) or equivalent code before main(). There is no stable way to get the longstanding behavior of inheriting the signal action from the parent process [1]. This is quite annoying, but not unique to Rust [2].

[1] https://doc.rust-lang.org/beta/unstable-book/compiler-flags/... [2] https://www.pixelbeat.org/programming/sigpipe_handling.html

collinfunk··on Bugs Rust won't catch
No need to apologize at all. Doing it in one cd invocation would fail since the file name is longer than PATH_MAX. In that case passing it to a system call would fail with errno set to ENAMETOOLONG.

You could probably make the loop more efficient, but it works good enough. Also, some shells don't allow you to enter directories that deep entirely. It doesn't work on mksh, for example.

collinfunk··on Bugs Rust won't catch
Hi, I am one of the maintainers of GNU Coreutils. Thanks for the article, it covers some interesting topics. In the little Rust that I have used, I have felt that it is far too easy to write TOCTOU races using std::fs. I hope the standard library gets an API similar to openat eventually.

I just want to mention that I disagree with the section titled "Rule: Resolve Paths Before Comparing Them". Generally, it is better to make calls to fstat and compare the st_dev and st_ino. However, that was mentioned in the article. A side effect that seems less often considered is the performance impact. Here is an example in practice:

  $ mkdir -p $(yes a/ | head -n $((32 * 1024)) | tr -d '\n')
  $ while cd $(yes a/ | head -n 1024 | tr -d '\n'); do :; done 2>/dev/null
  $ echo a > file
  $ time cp file copy

  real 0m0.010s
  user 0m0.002s
  sys 0m0.003s
  $ time uu_cp file copy

  real 0m12.857s
  user 0m0.064s
  sys 0m12.702s
I know people are very unlikely to do something like that in real life. However, GNU software tends to work very hard to avoid arbitrary limits [1].

Also, the larger point still stands, but the article says "The Rust rewrite has shipped zero of these [memory saftey bugs], over a comparable window of activity." However, this is not true [2]. :)

[1] https://www.gnu.org/prep/standards/standards.html#Semantics [2] https://github.com/advisories/GHSA-w9vv-q986-vj7x

collinfunk··on The West forgot how to make things, now it’s forgetting how to code
> There are some pretty substantial differences. Russia is on the strategic back foot here trying to figure out a way to stop NATO's advance.

His rationale for invading Ukraine was to "demilitarise and denazify" it. The NATO point seems largely be invented by people who dislike NATO in the west.

> They've only turned to violence after long attempts at resolving the tension diplomatically and the US has been implacable.

I hope the "tension" you are referring to was not the little green men taking over Crimea and the Donbas in 2014.

> Putin's actually been pretty hesitant in his escalations so far; he's 70 and has a long history of trying to avoid war.

This is a totally unseriousness statement. Can you remind me what Putin was doing in Syria again?

collinfunk··on The West forgot how to make things, now it’s forgetting how to code
You see zero similarities between Hitler invading Poland and Putin invading Ukraine?
collinfunk··on Ubuntu 26.04
Another maintainer and I follow issues and pull requests on a GitHub mirror. But email works fine for us and many other projects.

Regarding poor UX, it is difficult to dispute with that claim without a specific example. Note that a lot of the features we support are standardized by POSIX. Even if we dislike the behavior, it is better to comply with the standards so the programs don't behave differently than users expect. The sentence you quote isn't meant to put down users. These programs are often much more complex than meets the eye, and there are lots of common gotchas that people have run into (and will continue to do so) [1].

Of course we would love for these programs to be useful for everyone. However, feature requests are often incompatible with existing behavior, incompatible with other feature requests, or have existing functionality elsewhere. For those reasons we cannot accept every feature request.

[1] https://www.pixelbeat.org/docs/coreutils-gotchas.html

collinfunk··on Ubuntu 26.04
Well the TOCTOU issues do not require you to run untrusted scripts to be exploited. Another user on your system can use a legitimate command that you may run to make changes to files they shouldn’t be able to, or further escalate privileges.
collinfunk··on "cat readme.txt" is not safe if you use iTerm2
I am one of them. The title of the substack seems fine since it mentions "if you use iTerm2".

The tweet has no mention of iTerm2 which makes it sound like an issue in 'cat', which is mildly annoying [1].

[1] https://x.com/calif_io/status/2045207168677503241

collinfunk··on CVE-2026-3888: Important Snap Flaw Enables Local Privilege Escalation to Root
fileutils-1.0 was released in 1990 [1]. shellutils-1.0 was released in 1991 [2], and textutils-1.0 was released a month later in the same year [3].

Those three packages were combined into coreutils-5.0 in 2003 [4].

[1] https://groups.google.com/g/gnu.utils.bug/c/CviP42X_hCY/m/Ys... [2] https://groups.google.com/g/gnu.utils.bug/c/xpTRtuFpNQc/m/mR... [3] https://groups.google.com/g/gnu.utils.bug/c/iN5KuoJYRhU/m/V_... [4] https://lists.gnu.org/archive/html/info-gnu/2003-04/msg00000...

collinfunk··on Good software knows when to stop
The bar for adding new options, especially short options, is quite high for coreutils. We have a (likely outdated) page of rejected requests [1]. Some of the changes people have strong feelings about...

[1] https://www.gnu.org/software/coreutils/rejected_requests.htm...

collinfunk··on Statement from Jerome Powell
I don't think this addresses the main point of my question, though. Do you know any prominent Democrats, e.g., representatives, senators, or presidents, who have called for a Republican to be killed?
collinfunk··on Statement from Jerome Powell
Even if one grants that it is a small minority, aren't they still voting for someone who advocates for jailing and killing political opponents?
collinfunk··on Statement from Jerome Powell
Trump appointed him. Do you put not blame on him for choosing "uniparty birds" and "shades of grifters"? Or do you live in his colon.
collinfunk··on Statement from Jerome Powell
It seems like they learned a lot from the Letitia James and James Comey cases, which are going great (not in the way they intended).
collinfunk··on Gpg.fail
Haven't read it since it is down, but based on other comments, it seems to be an issue with cleartext signatures.

I haven't seen those outside of old mailing list archives. Everyone uses detached signatures nowadays, e.g. PGP/MIME for emails.

collinfunk··on Rust Coreutils 0.5.0 Release: 87.75% compatibility with GNU Coreutils
MacOS's utilities are really just FreeBSD's with some patches.

https://github.com/apple-oss-distributions/text_cmds https://github.com/apple-oss-distributions/system_cmds https://github.com/apple-oss-distributions/file_cmds https://github.com/apple-oss-distributions/adv_cmds https://github.com/apple-oss-distributions/shell_cmds https://github.com/apple-oss-distributions/misc_cmds

collinfunk··on Using Python for Scripting
FreeBSD 6.0 added 'env -S'. They have adopted a few different GNU inspired options recently, which I am happy about.
← PreviousPage 2 of 3Next →