by aetherspawn · 5y ago · 0 comments
Regardless, from the commit message:
> I didn't manage to come up with a reproducer in test environment, and the problem can't be reproduced after rebooting.
I've seen unit tests that try to reproduce race conditions. They're naive mirrors of the code that break as soon as you even think about changing the implementation. They're kind of pointless.
When you have a race condition that is difficult to reason about or reproduce, if you can distil it down to a test case that consistently fails until you fix it then you can be comfortable that your solution holds - yes it may be of little value going forward but it can be a very valuable part of the process.
It can also serve as documentation going forward, as whilst it may be brittle, when does fail hopefully the person will check the description/blame and instantly find the context as to why it exists, before using their judgement as to whether it is still valid or not. (Rather than changing something that looks odd and not realising that they've re-introduced the edge case)
They also run with sanitisers which can detect races and undefined behaviour.
And really good tooling also does formal verification to try and find any codepaths or inputs that could lead to an assertion failure.
I think any of the above 3 things would have had a reasonable chance of catching this issue.
Basically what used to be known as alpha/beta testing. Seems like there's more automated testing these days.
I work on a smaller piece of software with many automated tests that is significantly less reliable. I wonder if there's some lessons there. Another interesting tidbit is that our tests break a lot as well.
In "The Olde Days" many a pieces of complex/reliable software was written without a single unit test or any automated test for that matter. Sure, some of it had bugs, maybe even nasty bugs, but so does most software today. Have we made progress? maybe.
But there’s lots of code out there which doesn’t (or can’t) have a dedicated owner in the same kind of way. I had an issue opened on one of my GitHub projects the other day. I’m the sole maintainer of this project, the code is fiendishly complex and it’s working without any changes for about 18 months. Somebody found a bug! But after 18 months I’ve forgotten the mental context I had while writing that code - so I was terrified I’d break something else while fixing that problem. But I had an extensive test suite to fall back on. So when I fixed the bug and the existing tests all passed, I had the confidence to publish a new version. (And of course, I added the bug’s repro to the test suite for next time).
Lots of projects need guard rails like this. Maybe they’re solo projects. Or maybe there’s a lot of churn in the team. Sometimes there’s just more code than there are engineers to keep track of everything, so people are bouncing around a lot and don’t build much expertise in a single area. For the long tail of software, I’m pretty confident in saying unit tests have dramatically improved reliability beyond the standard we had a couple of decades ago. Have they made us lazier too? Maybe! But in my book they’re definitely a win on the whole.
…but it’s in the commit message, which is basically the same as a comment.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...
I love it when people put this level of detail into their commit messages, but this technique has one weak spot I don't know what to do about: if someone makes a change that confuses git's semantic heuristics - rename a function, split a file into two, etc. (or maybe all of them in a single commit), it creates a boundary for blame/log-trace that's hard to bridge.
But then, maybe I'm just not clever enough with git log -L ...
I've never done any kernel development, but with commercial code it's pretty common to have to dig backwards including going back to the issue tracker or even searching through company chat (Slack, email, etc) if the shop doesn't do [a good job with] documentation
But if you think about the implications of this strangeness, it can be equally interpreted as "Linus is playing a dangerous game" or "maybe we've kind of exaggerated the importance of unit tests, seeing Linux is doing fine".
Linux doesn't seem to stand out as exceptionally buggy. It has bugs, but then so does every project that's unit tested.
In theory they should still be useful, but in practice perhaps not.
There is nothing positive in forfeiting principles of good software engineering in the name of falsely perceived imbalance of stakes in the project. Instead of falling back on the biggest beneficiaries of the project for testing, we should have a participation model that welcomes contributions and improvements at all stages of development.
I've contributed to the kernel multiple times over the last few years and it was always a pain to some degree. Sometimes due to outdated contribution model, sometimes because of maintainer's personal preferences and allegiances.
Sadly current kernel dev culture still promotes exclusion and building walls instead of reducing tension and removing barriers for entry.
A large, automated test suite places a lot of extra burden on contributors and maintainers.
You will be expected to run tests, fix old tests, investigate flaky tests, and write new ones that cover your bug fix or new feature.
The kernel instead pushes the responsibility for writing test suites and validating new releases onto first Line consumers like Red Hat, IBM, Google etc all.
This is probably the only viable way to make it work. Maintainer resources are stretched thin as it is.
The result is never as good as it could be.
While the GNU/Linux was 20 years ahead, it's now more than 10 years late.
Also relevant: https://www.usenix.org/system/files/1311_05-08_mickens.pdf
> This is not the world of the systems hacker. When you debug a distributed system or an OS kernel, you do it Texas-style. You gather some mean, stoic people, people who have seen things die, and you get some primitive tools, like a compass and a rucksack and a stick that’s pointed on one end, and you walk into the wilderness and you look for trouble, possibly while using chewing tobacco. As a systems hacker, you must be pre-pared to do savage things, unspeakable things, to kill runaway threads with your bare hands, to write directly to network ports using telnet and an old copy of an RFC that you found in the Vatican. When you debug systems code, there are no high-level debates about font choices and the best kind of turquoise, because this is the Old Testament, an angry and monochro-matic world, and it doesn’t matter whether your Arial is Bold or Condensed when people are covered in boils and pestilence and Egyptian pharaoh oppression. HCI people discover bugs by receiving a concerned email from their therapist. Systems people discover bugs by waking up and discovering that their first-born children are missing and “ETIMEDOUT ” has been written in blood on the wall.
Using email for development isn't the 80s. It is very streamlined and built into the Git code itself and mail clients that are actively maintained like Mutt. Just because you can't imagine what life would be like without Gmail doesn't mean that these maintainers are less efficient and antiquated than you are.
> Coding standards based on old tty terminals
Don't even know what this means. What coding standard is based on old TTY terminals? TTY is part of Linux.
> No unit testing
Linux is the most widely used OS in enterprise. The internet runs on Linux. If you want unit tests for everyone then start an open source project to do this, or complain about the enterprises that aren't testing.
> Toxic leaders
Who is toxic? I love Linus's approach. It has allowed him to get things done without toxic people in the community trying to social engineer their way into destroying something good.
I'm guessing they're trying to poke fun at people who care about your code being too wide, and hard to read?
(But, while I no longer stick to a strict 80 column limit, like I used to, wide lines in code sucks. A proud mutt using systems engineer.)
You assume that there are not other tools to submit code and participate in discussion. That's obviously not true. Also the argument that "it is supported with git" is just a non-argument.
> Don't even know what this means. What coding standard is based on old TTY terminals? TTY is part of Linux.
You obviously don't know indeed. 80 lines comes from old teletype writers: http://www.navy-radio.com/tty.htm
And even Linus disagreed recently (http://lkml.iu.edu/hypermail/linux/kernel/2005.3/08168.html) but the limit was only increased to 100 columns. So yeah.
> Linux is the most widely used OS in enterprise. The internet runs on Linux.
And?
> If you want unit tests for everyone then start an open source project to do this, or complain about the enterprises that aren't testing.
That's just arguing from a position of power. There is an open source project by the way, named kunit, but it's obviously left as an afterthought. Testing is left to "community testing" which is just a way of saying "compile the whole thing, test the whole thing, let's wish somebody caught most bugs", which is just the naive way of doing things before automated testing became popular in the early 2000s.
> Who is toxic? I love Linus's approach. It has allowed him to get things done without toxic people in the community trying to social engineer their way into destroying something good.
There are tons of other successful open source projects that do have to rely on base insults and abuse. The fact that the way the Linux kernel hasn't changed a bit for 30 years just shows how much its community is intolerant to ideas.
There's a whole community of otherwise often cutthroat rivals cooperating somewhat peacefully on a truly giant software infrastructure project for 25+ years. A place where no one even asks about your skin colour, gender, religion or other abilities as long as you can submit correct code in a way that everyone is comfortable with. I'm fairly certain even Donald Trump, bin Laden, a seven year old school girl or a gay albino penguin could all get a patch accepted if the patch was OK. Edit: I'm fairly certain even Iranian and Israelian coders could get patches merged in the same release and nobody would even notice. Maybe it has even happened a number of times already for what I know. Same goes for hardcore Atheists, Buddhists, Catholics, Hindus, and what have you. We can't even know because the kernel people do not keep notes about that.
Then there are people coming from the outside trying to insert themselves as authorities not only on what tooling should be used but also as moral authorities down to the level of deciding on what language should be used.
Who were toxic did you say?
git was developed as a tool to support linux kernel development, why would you not support the right tool for the job? git was (and is) better than all the alternatives and is why kernel developers have stuck with it.
I guess if git offends you could just use patch files.
Or write something that is obviously so much better that people naturally switch to it.