An unintentional-looking but crash-causing bug There are a range of questions revolving around this concept, but these all seem to just involve causing a crash, resulting in many answers which are very obviously designed to cause a crash. So the challenge I set you is to write some plausible code (although what the codes supposed "intention" is I leave up to you), that crashes either the entire target OS, or just itself, in a way which is not immediately obvious. (I realize that what counts as "immediately obvious" is subjective, but hopefully the challenge is still reasonably clear).

The winner is the answer with the most votes after 5 days.
C, linux. Crashes system if run as root

/* Fork child process, wait 5 seconds and kill it */
pid_t pid = fork();
if(pid =! 0) {
    /* Parent */
    sleep(5);
    kill(pid, 11);
}
else {
    /* Child process. Would contain some code */
}


By changing != to =!, an innocent comparison is turned into an assignment. And given that pid 1 is init, and killing init causes a kernel panic, this is not code you would want to run as root :)