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.