How lines of code made a rocket explode.
--
Story of the most expensive software bug in the world.
On a fine June 4th, 1996, just 37 seconds after the celebrated launch, Ariane 5 rocket flipped 90 degrees in the wrong direction. Mission critical alarms started banging inside mission control; off the coast of French Guiana.
The rocket was making an abrupt course correction that was not needed, compensating for a wrong turn that had not taken place. In short, the on-board computer had concluded that a deviation in telemetry had occurred and it took measures by correcting the course — turning the rocket 90 degrees in the wrong direction. The computer looked at the Flight data coming from the Inertial Guidance system — the eyes and ears of the rocket- and saw Bizarre and nonsensical data —
but nevertheless, the inertial guidance system was passing off that data as authentic flight data- which really was not.
Somewhere inside the code base of the Inertial Guidance system, a sub-routine code module written in Ada — a statically typed, object oriented programming language extended mainly from Pascal, was trying to cram a 64 bit floating point number into an unprotected 16 bit signed integer, causing a processor trap — and a hardware exception, informally known as an overflow.
At T plus 37 seconds, the guidance systems of Ariane 5 shut itself down.
Less than two seconds later, at a height of 4 km, massive aerodynamic forces ripped the boosters apart from the main stage of the misaligned rocket. This triggered the self-destruct mechanism, and the spacecraft was engulfed in a spectacular fireball of liquid nitrogen, along with its payload of four expensive uninsured scientific satellites.
Someone hadn’t written proper exception handlers into the code base and Ariane 5 was now a fiery rubble across the mangrove marshlands of French Guiana, spread across 12 Square miles.
It took the European Space Agency 10 years and $7 billion to produce Ariane 5, and it was intended to give Europe an…