This one wasn't a programming error per se, but it'll do.
At a previous job, we had just received an oldish computer and were going to format it and reinstall Fedora on it. I had very little experience with Linux, but was under the watchful eye of our resident linux guru. We spent a couple of hours formatting it, reinstalling the OS, installing all the tools we needed etc. The way the workspaces were set up, there was a common codebase that was symlinked into the web directory. We set up the symlinks but there was a problem because the apache user didn't have the necessary permissions to read the files.
"No worries", we thought, we'll just change them all to be owned by the apache user.
chown -Rf apache ./*
(it's been a little while since I've done such a command, so please edit it if I got it wrong)
We hit enter and sat there looking at the blank screen for a few moments. Then I said "this seems to be taking a while...", and that's when we realised it was recursively changing the owner of all files both ABOVE and BELOW this one (following the ../ directories), to be owned by apache. CRAP! ^C!!! Ok ok, what do we do now??? Um um, I know!
chown -Rf root ./*
As that command was running, I said "Isn't that going to stuff up thing even more?". So we thought we'd close our eyes and hope it never happened and restart the computer. Of course, it was too late: even the process which brings up the "shutdown" dialog didn't have access to read the files it needed.
The only thing we could do was reformat and begin again.