frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Deep Down the Rabbit Hole: Bash, OverlayFS, and a 30-Year-Old Surprise

https://sigma-star.at/blog/2025/06/deep-down-the-rabbit-hole-bash-overlayfs-and-a-30-year-old-surprise/
54•Deeg9rie9usi•8h ago

Comments

x0x0•5h ago
Saving this to explain why software is hard.

For a long time, inode numbers from readdir() had certain semantics. Supporting overlay filesystems required changing those semantics. Piles of software were written against the old semantics; and even some of the most common have not been upgraded.

JdeBP•2h ago
The opposite, if anything. Very little was written against the old semantics, with most of the time the supplied C library providing what was needed, and so the code that did rely upon old semantics barely got exercised. A little-used shim that had been broken wasn't noticed, in other words, until just the right combination of circumstances got the shim being used on a platform where it would break.

What there are piles of, are softwares that reinvent the C library, all too often in little bits of conditionally-compiled code that have either been reinvented or nicked from some old C library and sit unused in every platform that that application is nowadays ported to. Every time that I see a build log dutifully informing me that it has checked for <string.h> or some other thing that has been standard for 35 years I wonder (a) why that is thought to be necessary in 2025, and (b) what sort of shims would get used if the check ever failed.

saurik•5h ago
FWIW, if you are cross-compiling, while you might get a vaguely usable result by ignoring all of the warnings and letting worst-common-denominator defaults get applied, you absolutely should be paying more attention and either manually providing autoconf the answers it needs or (if at all possible, as this is more general) make sure to tell it how to run a binary on the target system (maybe in an emulator or over ssh)... you shouldn't just be YOLOing a cross-compile like this and expecting it to work (not to say that this wasn't a good bug in the fallback to fix, just that the premise is awkward).
iforgotpassword•4h ago
Like for example when compiling Linux (plus user space) from Windows XP using only the official Services for Unix package from Microsoft as a starting point.
pogopop77•4h ago
Interesting investigation, good read. Definitely illustrates how new paradigms (i.e. overlay filesystems) can subtly affect behaviors in ways that are complex to track down.
akoboldfrying•2h ago
Remember, folks: It's not enough to check $WEARING_PANTS before stepping outside. You need to check !$PANTS_BROKEN && !$SOLARIS too.
jwilk•2h ago
> Once the bug report becomes publicly visible, it will be linked here.

Here it is: https://lists.gnu.org/archive/html/bug-bash/2025-06/msg00149...

chubot•1h ago
Wow great bug!

> Bash forgot to reset errno before the call. For about 30 years, no one noticed

I have to say, this part of the POSIX API is maddening!

99% of the time, you don't need to set errno = 0 before making a call. You check for a non-zero return, and only then look at errno.

But SOMETIMES you need to set errno = 0, because in this case readdir() returns NULL on both error and EOF.

I actually didn't realize this before working on https://oils.pub/

---

And it should go without saying: Oils simply uses libc - we don't need to support system with a broken getcwd()!

Although a funny thing is that I just fixed a bug related to $PWD that AT&T ksh (the original shell, that bash is based on) hasn't fixed for 30+ years too!

(and I didn't realize it was still maintained)

https://www.illumos.org/issues/17442

https://github.com/oils-for-unix/oils/issues/2058

There is a subtle issue with respect to:

1) "trusting" the $PWD value you inherit from another process

2) Respecting symlinks - this is the reason the shell can't just call getcwd() !

    if (*p != '/' || stat(p, &st1) || stat(".", &st2) ||
        st1.st_dev != st2.st_dev || st1.st_ino != st2.st_ino)
        p = 0;
Basically, the shell considers BOTH the inherited $PWD and the value of getcwd() to determine its $PWD. It can't just use one or the other!
justincormack•1h ago
Most of the stuff that configure scripts check is obsolete, and breaks in situations like this as the checks are often not workable without running code. It is likely the check does not apply to any system that has existed for decades. Lots of systems have disabled eg Nix in 2017 [1]

[1] https://github.com/NixOS/nixpkgs/commit/dff0ba38a243603534c9...

malkia•52m ago
Autoconf is the prime example of easy vs simple.

It looks easy on the surface to roll down support for any kind of operating system there is, based on auto-detection and then #if HAVE_THIS or #if HAVE_THAT, but it breaks in ways that maybe really hard to untangle later.

I'd rather have a limited set set of configurations targeting specific platforms/flavors, and knowing that no matter how I compile it, I would know what is `#define`-d and what is not, instead of guessing on what the "host" might have.

A new pyramid-like shape always lands the same side up

https://www.quantamagazine.org/a-new-pyramid-like-shape-always-lands-the-same-side-up-20250625/
153•robinhouston•2h ago•33 comments

Gemini CLI

https://blog.google/technology/developers/introducing-gemini-cli-open-source-ai-agent/
840•sync•9h ago•465 comments

-2000 Lines of code

https://www.folklore.org/StoryView.py?story=Negative_2000_Lines_Of_Code.txt
81•xeonmc•2h ago•34 comments

A new PNG spec

https://www.programmax.net/articles/png-is-back/
421•bluedel•1d ago•437 comments

What Problems to Solve (1966)

http://genius.cat-v.org/richard-feynman/writtings/letters/problems
255•jxmorris12•5h ago•35 comments

Libxml2's "no security embargoes" policy

https://lwn.net/SubscriberLink/1025971/73f269ad3695186d/
59•jwilk•2h ago•25 comments

Microsoft Dependency Has Risks

https://blog.miloslavhomer.cz/p/microsoft-dependency-has-risks
42•ArcHound•2h ago•25 comments

The Offline Club

https://www.theoffline-club.com
47•esher•2h ago•15 comments

Getting ready to issue IP address certificates

https://community.letsencrypt.org/t/getting-ready-to-issue-ip-address-certificates/238777
181•Bogdanp•6h ago•100 comments

OpenAI charges by the minute, so speed up your audio

https://george.mand.is/2025/06/openai-charges-by-the-minute-so-make-the-minutes-shorter/
383•georgemandis•9h ago•109 comments

Build and Host AI-Powered Apps with Claude – No Deployment Needed

https://www.anthropic.com/news/claude-powered-artifacts
132•davidbarker•5h ago•52 comments

Writing a basic Linux device driver when you know nothing about Linux drivers

https://crescentro.se/posts/writing-drivers/
108•sbt567•3d ago•9 comments

LM Studio is now an MCP Host

https://lmstudio.ai/blog/lmstudio-v0.3.17
115•yags•5h ago•42 comments

Iroh: A library to establish direct connection between peers

https://github.com/n0-computer/iroh
109•gasull•5h ago•34 comments

Building a Monostable Tetrahedron

https://arxiv.org/abs/2506.19244
17•robinhouston•2h ago•1 comments

Better Auth, by a self-taught Ethiopian dev, raises $5M from Peak XV, YC

https://techcrunch.com/2025/06/25/this-self-taught-ethiopian-dev-built-an-authentication-tool-and-got-into-yc/
12•bundie•4h ago•4 comments

FurtherAI (YC W24) Is Hiring for Software and AI Roles

https://www.ycombinator.com/companies/furtherai/jobs
1•sgondala_ycapp•5h ago

Web Embeddable Common Lisp

https://turtleware.eu/static/paste/wecl-test-gl/main.html
89•todsacerdoti•6h ago•30 comments

Interstellar Flight: Perspectives and Patience

https://www.centauri-dreams.org/2025/06/25/interstellar-flight-perspectives-and-patience/
42•JPLeRouzic•5h ago•76 comments

America’s incarceration rate is in decline

https://www.theatlantic.com/ideas/archive/2025/06/prisoner-populations-are-plummeting/683310/
47•paulpauper•5h ago•97 comments

Bot or human? Creating an invisible Turing test for the internet

https://research.roundtable.ai/proof-of-human/
82•timshell•7h ago•103 comments

LLM Hallucinations in Practical Code Generation

https://dl.acm.org/doi/10.1145/3728894
28•appwiz•2d ago•2 comments

Coccinelle for Rust progress report

https://www.collabora.com/news-and-blog/blog/2025/06/25/coccinelle-for-rust-progress-report/
21•mfilion•3h ago•2 comments

Is Lovable getting monetization wrong?

https://getlago.substack.com/p/lovable-makes-60m-in-6-monthsbut
89•FinnLobsien•8h ago•53 comments

Games run faster on SteamOS than Windows 11, Ars testing finds

https://arstechnica.com/gaming/2025/06/games-run-faster-on-steamos-than-windows-11-ars-testing-finds/
106•_JamesA_•2h ago•19 comments

Primitive Kolmogorov complexity is computable

https://lewish.io/posts/primitive-kolmogorov-complexity-is-computable
5•1ewish•2d ago•1 comments

Reading NFC Passport Chips in Linux

https://shkspr.mobi/blog/2025/06/reading-nfc-passport-chips-in-linux/
253•robin_reala•14h ago•92 comments

DeepSpeech Is Discontinued (2020)

https://github.com/mozilla/DeepSpeech
36•LorenDB•5h ago•20 comments

Yet another insignificant programming notes

https://chua.bitbucket.io
14•__LINE__•2d ago•2 comments

I built an app to backup Live Photos from iPhone to external hard drives

51•xmasterdev•2d ago•26 comments