I once wrote a bit of code for an industrial device that controlled access to a factory. It was basically a CPU with some relays that could activate bars and semaphores and whatnot. Everything works in test, the guys install everything, and soon I get called with complaints that the software frequently crashes after completing an entrance operation - the bar opens to let the truck through, and then the program crashes.
After some fruitless attempts to diagnose the problem by phone, I get there and start trying to figure out what's wrong. To avoid stressing the bars' engines unnecessarily, and to let trucks through without delay, we disconnect the bars, and start debugging. A sizable chunk of the day is spent attempting to reproduce the problem, which seems to have mysteriously vanished. We think of the bars, but all we've done is disconnect them from the relay; the software cannot possibly be affected by that.
Or can it? Bonus points if you guessed the solution by now. We reconnect the bars' engines, and the issue shows up, big way. Every time the program completes an entrance operation, it then proceeds to explode spectacularly. The effects look a bit like a massive buffer overflow, with random garbage ending up everywhere, but we can't see any way for any buffer to go anywhere it shouldn't. Then I get a suspicion, build a little test thingy that just opens the bars, and have the suspicion confirmed.
Every time the bars' relay switched with the engines attached, it let loose an EMP that traveled up the relay controller and scrambled the CPU's registers. I bet readers with some electrician background have been sneering at me for a while now, but what can I say? I do software!
Installation of filters fixed the issue, and AFAIK the system has worked perfectly for the last 10 years or so.