logoalt Hacker News

thomashabets2 • today at 9:06 AM • 3 replies • view on HN

You're painting a picture that code written with love is perfectly safe. It's not.

Yes, openbsd has not had a torrent of bugs found, but I would say that the vastly bigger reasons for that are: 1) orders of magnitude people care about burning tokens and money to find the bugs in an OS almost nobody uses, and 2) it's simply much smaller. Can't have Bluetooth bugs if you don't have a Bluetooth stack.

I've pointed LLMs at obsd stuff, and even the simplest code, e.g. cat & find, had bugs and buffer overflows.

OpenBSD also has a poor patch tracking system, since they're still on CVS. A patch has an extremely good chance of just falling through the cracks. Security or not.

So no. Nobody can write safe C. Not hobbyists, and not "those evil corporations".


Replies

RetroTechie • today at 4:03 PM

> So no. Nobody can write safe C. Not hobbyists, and not "those evil corporations"

There's no fundamental reason why all the checks applied by say, a Rust compiler, couldn't be applied to a piece of C code. Or checks that go well beyond that.

Tools exist to produce extremely reliable code (or even proven-correct code) for a number of languages.

But chances are those tools aren't used to the extent they could be. Or differences in developer culture on different projects. Some PHP web developer will (on average) have different resources, priorities & work ethics than say, someone working on avionics software.

If AI, advanced tool, or a security researcher can find a bug in existing code, then (at least in theory) same bug could have been found before it hit a repository.

But no... push "release", fix issues afterwards when reported. Gotta have developer velocity, right?

Imho it's more a choice rather than "can't write safe code in X".

If you don't believe that: pick a random open source project, and go through some changelogs. Feature introduced in version X, reverted in version X+1 because it broke existing stuff. Feature removed because hadn't-been-working-for-years-anyway. Code added to do X, but no.. doesn't do X, just the scaffolding to do X in next version. Code worked fine & passed tests on system A, but found to be needing a byte-swap on other-endian platform B.

Etc, etc, etc. There's just so much code out there that was broken on day 1. And not rarely known to be so, but released anyway.

pelagicAustral • today at 10:16 AM

> an OS almost nobody uses

Don't hold back...

➕ show 1 reply
za_creature • today at 10:20 AM

[flagged]

➕ show 1 reply