4 ms·
I've seen some very strange things in my career. I find posts like this delightful, because I can point to them and say "see, here is proof that even code writ
by zackmorris 12y ago
I've seen some very strange things in my career. I find posts like this delightful, because I can point to them and say "see, here is proof that even code written with the best of intentions can still have bugs."
Programmers tend to fall into (at least) two camps: the skeptics and the pragmatists.
Sometimes when I report a finding, programmers accuse me in one way or another of messing something up because “that can’t possibly be failing.” Those are the skeptics, using incredulousness almost like a shield to protect their worldview. They tend to have an up-close/what’s right in front of them approach to programming, are prolific and usually take a positive stance on programming.
At other times, reporting a finding is met with resignation, almost like “please work around it because we just don’t need this right now”. Those are the pragmatists, taking the long view/forest for the trees approach, knowing that programming is more than the some of its parts but also that it’s a miracle it even works at all. They are the daydreamers and sometimes are perceived as negative or defeatist.
I was a pragmatist for as long as I could remember, but had a change of heart working with others in professional settings. I saw that certain things like databases or unix filesystems could largely be relied upon to work in a deterministic manner, like they created a scaffolding that helps one stay grounded in reality. They help one command a very mathematical/deliberate demeanor, and overcome setbacks by treating bugs as something to be expected but still tractable.
But here is one of those bugs, where the floor seemed to fall out from under our feet. One day I mentioned that “SSL isn’t working” and about half the office flipped out on me and the other half rolled their eyes and had me track it down:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=694667 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=694667
The gist of it is that OpenSSL was failing when the MTU was 1496 instead of 1500, because of path MTU discovery failing and SSL thinking it was a MITM attack and closing (at least, that is how I remember it, I am probably futzing some details).
That was odd behavior to me, because I see SSL as something that should be a layer above TCP and not bother with the implementation details of underlying layers. It should operate under the assumption that there is always a man in the middle. If you can open a stream to a server, you should be able to send secure data over it.
Anyway, we fixed the router setting and got back to work. All told I probably lost a day or two of productivity, because the office network had been running just fine for years and so I discounted it for a long time until I ruled out every other possibility. I’ve hit crazy bugs like this at least once a year, and regret not documenting them I suppose. Usually by the time they are fixed, people have forgotten the initial shock, but they still remember that you are the one weirdo who always seems to break everything.
- cjbprime 12y agoYeah, I like the phrase "suspecting a compiler bug is the principle of last resort". (Maybe there should be an "unless you're using Rust" thrown in there.) It's not that compilers can't have bugs. It's that you're more fallible than the compiler, and should use that likelihood when deciding where to investigate to fix the bug you're seeing.
- Retric 12y agoI remember a long day tracking down a bug in some low level networking code that turned out to be bad RAM on a test machine. I remember thinking "This is probably what going crazy feels like." But, I still trusted the compiler more than the HW.
- kedean 12y agoTo be fair, this was a bug in the standard library, not the compiler. You should also trust your stdlib too, though, unless its a demonstrable problem like the article.
- todd8 12y agoYes, there are certain tools that I trust almost completely, like TeX [1], and it helps me focus on finding my own bugs because I'm not tempted to spend some time wondering if is the tool (build tools, library, compiler, etc.) with the bug and not my own code. [1] http://texdoc.net/texmf-dist/doc/generic/knuth/errata/errorlog.pdf http://texdoc.net/texmf-dist/doc/generic/knuth/errata/errorl...
- gus_massa 12y agoYes, TeX is almost bug free. But once you start to use LaTeX you are not long so safe. If you use two LaTeX packages, you have to pray that they are compatible, and they are loaded in the right order. If you have to use babel (because you don't speak in english) you are probably out of luck.
- todd8 12y ago