Live data from Hacker News

Re: Integrating "safe" languages into OpenBSD? (2017)

marc.info

321–330 of 400 posts

Re: Re: Integrating "safe" languages into OpenBSD? (2017)

#321

Earlier quoted context omitted.

This rule is not just dumb, it is retarded. I maintain a quite popular open source project, and OpenBSD maintains a fork. They try to submit patches every now and then, but every time it happens, I ask them to please also submit a test that makes CI fail without the patch, and pass with it. They can't, so OpenBSD remains unsupported. The problem is that there isn't a supported cross-compilation toolchain from any maj…

I don't know what project this is but a blanket "add a test which fails without your patch for EVERY PATCH no exception" rule is a bit cargo-culty. Especially since the kind of test you're asking for, when written by a developer who is less than passionate about writing such a test but rather more passionate about just solving the problem his patch addresses, is probably not going to be worth much compared to a prope…

> I don't know what project this is but a blanket "add a test which fails without your patch for EVERY PATCH no exception" rule is a bit cargo-culty.

We had (and still have) 100% code coverage on Windows MSVC, Windows GNU, MacOS, iOS, Android, Linux, FreeBSD, NetBSD, DragonflyBSD, Solaris, WASM, and many other platforms, as well as all possible hardware (ARM32/64, x86/x64, ppc32/64/be/le, sparc64, mips32/64/be/le, mips64, riscv32...).

The OpenBSD parts of our code base weren't tested at all; they weren't even compiled.

In practice that meant that pretty much every PR broke the OpenBSD support in some subtle way, and people would only discover those failures during the release process, which took a lot of time to fix, usually from somebody that did not care about OpenBSD at all, requiring them to create a VM to be able to develop and test from OpenBSD itself.

So yeah, we decided to unanomously require that code that cannot be tested be removed, and gave the OpenBSD devs the chance to fix it. Starting with requiring OpenBSD contributor on their PRs to add testing support.

It wasn't practicable because their platform is designed to prevent non-OpenBSD users to develop for it. So we removed the code, and this became some OpenBSD user group problem.

This solution actually worked better for them, because it became up to them to decide when new versions of our project got released for OpenBSD, so they could get the latest release, apply patches, test that it compiled locally and passed tests, etc. before doing a release for OpenBSD, something that we did not care about doing.

We believe that code that isn't compiled doesn't compile, and that code that isn't tested doesn't work correctly. Our OpenBSD parts were living proof that this is 100% true.

I find it quite ironic that this project is security related, and some of the bugs that hit OpenBSD were CVEs that were completely preventable. This CVEs only hit OpenBSD because it was the only untested platform. In a sense, OpenBSD users actually were quite lucky, in that most releases broke compilation for OpenBSD, and that saved them from many CVEs. Unluckily for them, not all bugs result in compilation errors.

> Finally, surely you get plenty of patches which do small useful things like cleanup but which it would likely be impossible to write a test for.

We have 100% code coverage. All our functionality is heavily tested and fuzzed. The modifications in a cleanup PR are exercised by many tests, and therefore tested.

If someone submits a bugfix, that means we were missing a test, so we require users to add one. OpenBSD devs weren't able to do that, so we stopped accepting their bugfixes, and at some point removed all the code.

If you don't think that bugfixes should be accompanied by tests that check that the fix works and the bug cannot be reintroduced again, then I disagree with you, and hope I never have to use your software.

Re: Re: Integrating "safe" languages into OpenBSD? (2017)

#322
post #146

Earlier quoted context omitted.

If you care about security, api stability and legal compliance, you should minimize the number of developers and packages you trust. My rule of thumb is that, for a team of ~10 developers, each package dependency adds a week or two of developer maintenance time each year or so. Having a dozen packages where one will do, and having them do the same thing recursively means you need to spend 144 times longer dealing wit…

Why is number of packages and not package size the relevant metric here? Especially when all the packages live in the same repository, there's practically no more overhead to review each package qua package, versus just a bunch of directories in a package monolith. This "144 times longer" number seems pulled completely out of thin air.

Twelve packages with twelve dependencies each is 144. I’ve seen >10x this level of blow up on multiple products at multiple companies.

One company missed installing malware behind all the firewalls of most of the fortune 500 by less than a week.

We made a procedural change to the build process of a product that had been shipping for years.

The change hit our CI/CD 5 days before one of the big language package managers started spewing malware at us.

Package maintainer count bloat is a serious real world problem.

Ignoring it is negligent.

Re: Re: Integrating "safe" languages into OpenBSD? (2017)

#323
post #306

Earlier quoted context omitted.

> When was the last time you saw a remote hole in the default install of, say, Ubuntu desktop? Literally right now, with snaps. If you only mean unintentional remote holes, and not deliberate backdoors, then we have very different ideas of what "most secure general purpose operating system" means. Also, BSD doesn't generally actively refuse to fix security holes when thousands of people compain about them.

Granting your framing for the sake of argument, then we've got one remote hole in a heck of a long time in Ubuntu desktop, and still nothing in macOS or Amazon Linux. I'm certainly not claiming that any of these OSes is better than OpenBSD. I'm claiming they're all about the same, and the "OpenBSD cares more about security than everyone else" narrative isn't actually based in evidence. OpenBSD has a particular view o…

> we've got one remote hole

Are you forgetting the time they sent local filesystem searches to some spyware company? And that's just things that were a: deliberate, and b: public enough that I remember them off the top of my head despite not having used Ubuntu in years? (I forget which specific problem made me drop it, or I'd probably have a third example.)

OSX is a toxic, vendor-supplied-malware infested cesspit that I've never used and don't pay much attention to, and I've never even heard of Amazon Linux, so I wouldn't expect to have examples for those.

> the "OpenBSD cares more about security than everyone else" narrative

Actually, my claim was that Ubuntu (and maybe a significant fraction of "everyone else", but that wasn't really my point) is actively opposed to security.

> even if we don't admit a difference between unintentional remote holes and "deliberate backdoors,"

There is a difference; there's a huge difference; deliberate backdoors are much, much worse. This kind of shit is something I would expect of Microsoft (Windows) or Google (Chrome).

Re: Re: Integrating "safe" languages into OpenBSD? (2017)

#324

I have been using bat and exa along with alacritty for a while. All of them are pretty good https://github.com/alacritty/alacritty https://github.com/sharkdp/bat https://github.com/ogham/exa

exa still just flat out crashes when supplied with a ctime pre 1970. If that's supposed to be a poster child of how well rust tools work, I fully understand Theo's vitriol.

For anyone wondering, here's the bug: https://github.com/ogham/exa/issues/550

Re: Re: Integrating "safe" languages into OpenBSD? (2017)

#325

Let's try to summarize what he tries to say but kinda doesn't do very well: _Rust and OpenBSD are not a good fit._ OpenBSD keeps to certain aspects about how to do thinks which just don't work well with rust. This doesn't mean they are better or worse. They are just different. For example outside of rustc-dev hardly anyone compiles rust them self. As such not many work on making rust compile itself on exotic systems…

> For example outside of rustc-dev hardly anyone compiles rust them self.

Yep, and it shows (as many other threads point out). Gentoo users are one of the populations that is more likely to compile rust from scratch, but many likely use rust-bin because the build times, toolchain dependencies, etc. are all completely insane non-starters. If the rust evangelists want people to take them seriously, they need to have serious answers to serious engineering questions and concerns and not simply respond with "but memory safety!"

Amusingly this recalls the kernel mailing list thread where Linus says "I think the OpenBSD crowd is a bunch of masturbating monkeys" because they focus too much on security. Well damn if Theo didn't just effectively say about the rust evangelists what Linus said about him. You have to be severely out of touch to not understand, much less dismiss, the basic features that OSes require of language ecosystems. I mean, these are so basic that if you show up without those features you will be rightly shown the door because you haven't done the simplest requirements gathering much less the actual engineering work that anyone would be expected to do if they wanted to be part of core infrastructure.

Re: Re: Integrating "safe" languages into OpenBSD? (2017)

#326

Earlier quoted context omitted.

Urgh, that's just a verification nightmare waiting to happen. Who is going to wade through all that mess, review every package, pin its version etc...? You need reproducability before you can get safety and security.

Cargo uses lockfiles by default to pin all dependencies of an application, so reproducibility shouldn't be much of an issue.

No one reads lockfiles. In python, people have successfully backdoored projects by sending a PR that upgrades a dependency and regenerates the lockfiles.

Somewhere in the 1MB lockfile patch, they pin a dependency to a version with a known remotely exploitable flaw (sometimes a zero day, sometimes not).

Re: Re: Integrating "safe" languages into OpenBSD? (2017)

#327
post #272

Earlier quoted context omitted.

I'll put it in context. Let's say I have leftover garbage in usr/local/lib. I clone a new project that I need to patch because it's broken. I try to fix the new project but the fix isn't working. I have no idea why. I spend hours trying to trace down the problem. What was the issue? The project picked up some of the old garbage libraries I had in usr/local/lib, which had a bug that made my fix not work. For developer…

> I spend hours trying to trace down the problem. This is the problem. Once you understand library loading, once on your system, and learn, once , how to query the system and see what libraries are being loaded and from where, you won't have to waste hours on this problem again. Until that point, you're operating a system without understanding, and that will always lead to breakage.

I've installed hundreds of pieces of software from source, and I have a fairly decent idea of how linking and loading works. I still have to spend time figuring out why something doesn't build when it should due to something strange about my system.

Re: Re: Integrating "safe" languages into OpenBSD? (2017)

#328
post #266

> For instance, rust cannot even compile itself on i386 at present time because it exhausts the address space. Wow, that one was really cruel.

Seriously who cares about i386 in 2020?

Anything sane with an older machine as a backup one.

Re: Re: Integrating "safe" languages into OpenBSD? (2017)

#329
post #279

Earlier quoted context omitted.

As someone who’s spent a lot of time as a sysadmin over the years, your last comment sounds backwards to me. The DevOps trend has pushed more general awareness and Docker has played a key role in three ways: making explicit automation requirements for the setup process (Dockerfiles have to work, unlike that MS Word document someone last updated 3 years ago), being private by default and requiring someone to reverse e…

> The key to understanding the benefit is the power of having done this in a standard, widely used way which is supported by many tools, used by an increasing fraction of projects, and which makes knowledge and training broadly portable. You're talking about Makefiles here circa 25 years ago, right? Makefiles have to work, and /bin/sh is still there last I checked on my machine. The problem with the broadly portable…

> Makefiles have to work

And yet I get GNU Makefiles all the time that don't work when I type "make" at my computer, since they use things that aren't compatible with my version of Make. It's clearly more of a problem than you think it is.

Re: Re: Integrating "safe" languages into OpenBSD? (2017)

#330
post #271

Perhaps relevant: Ted Unangst recently wrote some Rust code: https://flak.tedunangst.com/post/reliverator

...and he's comparing Cargo to Clippy. https://honk.tedunangst.com/u/tedu/h/L213K3jf7r3K1534yQ https://honk.tedunangst.com/u/tedu/h/fDM95Cx9t6g1LqTZb3 https://honk.tedunangst.com/u/tedu/h/mBD3rD9pwnf8wxD6j9

He's not comparing cargo to clippy, he's talking about clippy, a community driven linter that checks your code style beyond what rustc itself does. It is executed with the command `cargo clippy` once it is installed.
Post reply on HN