On June 4th, 1996, the first Ariane 5,the European Rocket was destroyed by its automated self-destruct system 37 seconds after launch
The root cause of this destruction was a software bug on the navigation system that had been re used from Ariane 4 and not tested enough…
The bug report is available online, his reading is very instructive.
You can find it here.
You can also read the good article in wikipedia.