What's your worst bug?

“Because of a subtle bug called a “race condition,” a quick-fingered typist could accidentally configure the Therac-25 so the electron beam would fire in high-power mode but with the metal X-ray target out of position. At least five patients die; others are seriously injured”

History’s Worst Software Bugs, from Wired.

I’m pretty careful about how I write code and I like to have my tests in place and, on the whole, I write pretty reliable code (most of the time) but I’m still glad that I don’t work on stuff that’s likely to cost lives if it goes wrong…

Probably the worst bug that I wrote was in some software that personalised Smart Cards. The software created “electronic purse” cards for a Russian bank in Siberia and the card production system for the first batch of cards that were produced on the live system had a bug in it. I can’t quite remember the full details but I’d misread the smart card spec and the card production system was writing a bit to a register that it shouldn’t have and by doing so was preventing any further changes to the card. The cards were intended to be upgraded to support more functionality in the future and the bug meant that the bank would need to reissue the cards rather than upgrade them whilst they were in use. I still remember the cold feeling that came over me when I realised what I’d done; I was working on the ‘upgrading’ code and couldn’t work out why the card wouldn’t let me do what I wanted… I told my boss and it was an easy fix and the bank hadn’t produced as many cards as we thought and they were less sure they’d actually need to change them, but still…

What’s your worst bug?