Dumb things to do with your FreeBSD

I had the MVS consoles of three virtual machines open in three windows, and the production console, which I only had read-only access to, in a fourth. Went to shut down a virtual machine, but accidentally typed my command in the production window. Production system came down. Operations was cool. They said “I didn’t know you had command access to the production system.” I said “I didn’t, either. Please take it away.”

Did that as a grad student, on a MVS system. We had a weird setup, using IBM's base MVS, libraries and linker, but Fujitsu's Fortran compiler (because it was better). Note that I was a completely normal unprivileged user. One day I decided to organize my code better, by breaking up the main program into subroutines. The most important one I called "main()", which seemed to make sense to me. Compile, link, and the MVS system that serves 500 people crashes. Oh well, that happens occasionally. Come back half hour later, edit my code a little bit, compile, link, and computer crashes again.

The next time I went to the big terminal room that was after lunch, and right after I logged in, one of the operators (in the usual white lab coat) came over and tapped me on my shoulder: they had tracked down whose actions had crashed the machine. So a few systems programmers came over, and asked me to show them exactly what I had done. So I showed them, and (as to be expected) the machine crashed a third time. They were amazed, and told me to stay off the computer completely for a day or two.

Ultimately, it was easy for them to debug: in MVS, the linker is a privileged system program, and as such it is not bound to resource limits (such as how much memory it can consume). There was a slight incompatibility between the IBM linker and the Fujitsu compiler, which lead to the following: The Fujitsu compiler already quietly creates a subroutine called "main()", which contains the entry point of the program. The linker knows that main() is special, and is where the program is to be started. But then when trying to link in all the required subroutines, it found my own copy of main(), which has the same name (which can not happen!) but a subtly different calling sequence (it is not an entry point). So the linker added a copy of my main to the executable it was building in memory (you can see where the story is going). Then it noticed that the subroutine called main() was calling another subroutine called main(), but confused the two of them, and added another copy of my main(). And it repeated that last step, until it had consumed all memory on the machine, even the memory reserved to the OS itself, leading to an instantaneous crash. If the linker had been a normal user-level program, it would have crashed cleanly and the other 499 users wouldn't even have noticed, but because it was exempt from resource limits, it could "eat the whole thing".

The fix is trivial: Never write a subroutine called main() in Fortran, call it central() or work() or master() or use a German word instead.
 
...But they didn't support MS-DOS (which in those days could use TCP/IP by buying an Ethernet card and installing some bizarre hacky software (either commercial from FTP software or K9something). So one grad student decided to do it himself, and brought the whole network down by using the address of the gateway as his address.
I managed to get a DOS machine on to a TCP/IP network using Novell ODI drivers. I even managed to make it be dual-homed. I still consider that one of my best hacks.

The second time was in the late 90s, and I was working at a company that sold big industrial equipment to semiconductor fabs. One of our machines got shipped to the biggest and most influential chip maker of the time, in spite of having failed QA testing in house (we needed the revenue, and the QA director who wanted to veto sending the machine to a customer was overruled). It brought down the whole network in the fab, and it took <insert famous chip maker here> 3 days to restart chip fabrication. Not going to discuss all the fallout from this, but it was a blood bath.
Yeah, I tried to get us to not ship broken software to a large financial services company, but I was only a lowly CPE (Current Product Engineer.) At least I had a patch ready when they complained.
 
Dumbest thing I did, huh... Some of those qualify as 'learning experiences' that simply took up a LOT of my time - like trying to compile a few compilers like GCC on weak processors like a Sandy Bridge i5 2467M. Or another time, I wanted to assemble a computer from aftermarket parts (so that I could install FreeBSD on it). Bought a cheap $20 USD Apevia PSU. It fried the motherboard, so I had to get a replacement, which was over $100 USD... in addition to a ~$50 USD EVGA PSU. Lesson learned from that experience - don't cheap out on components from unusual brands.
 
Back
Top