Outage4 Jun 1996

Ariane 5 Flight 501

Code reused from Ariane 4 overflowed a 16-bit integer 37 seconds after launch, and the rocket destroyed itself.

Severity
Front-page news
Difficulty
beginner
Companies
European Space Agency, Arianespace, CNES
Tech
Embedded systems, Ada, Inertial navigation, Exception handling
Root cause
latent bug

The story

Quick (1 min)

On 4 June 1996, the first Ariane 5 rocket launched from Kourou in French Guiana. About 37 seconds later it suddenly veered off course, broke up and self-destructed.

The cause was software. Ariane 5 reused navigation code from the older Ariane 4. Ariane 5 flew faster sideways early in flight, so one value got bigger than the old code ever expected. Converting it into a small 16-bit number overflowed and raised an error.

The error shut down the navigation computer. The backup ran the same code and had already shut down the same way. The main flight computer then read error data as if it were real flight data, and steered the rocket hard off course.

The lesson: reused code carries hidden assumptions. Test it against the new system's real conditions.

Keep reading to the end to earn XP.Read. XP earned.

Engineer (2 min)

What failed. Ariane 5's Inertial Reference System (SRI, Système de Référence Inertielle) tells the on-board computer where the rocket is pointing. There were two SRI units for redundancy, both running the same software, much of it reused from Ariane 4.

The overflow. An alignment function computed a value called BH (Horizontal Bias). This function was only useful before lift-off, but a requirement inherited from Ariane 4 kept it running for about 40 seconds into flight. Ariane 5's early trajectory had much higher horizontal velocity than Ariane 4's, so BH grew far larger than on Ariane 4. Converting BH from a 64-bit float to a 16-bit signed integer overflowed and raised a hardware exception.

Why it wasn't protected. Programmers had added overflow protection to only four of seven critical variables. They wanted to keep the computer's workload under an 80% target, and relied on value ranges that were true for Ariane 4 but not Ariane 5.

Why redundancy failed. The specification said that on any detected exception the processor should stop. Both SRIs ran identical code on identical data, so the backup failed first and the active unit failed immediately after, at around H0 + 36.7 seconds.

Why it crashed instead of degrading. The failed active SRI sent a diagnostic bit pattern. The on-board computer interpreted it as flight data and commanded full nozzle deflection on the boosters and main engine. The angle of attack exceeded 20 degrees, the boosters started to separate, and the self-destruct system triggered correctly.

Interview takeaway: "halt on any exception" is a dangerous default for critical systems, and hardware redundancy doesn't protect you from a software bug.

Keep reading to the end to earn XP.Read. XP earned.

Deep dive (3 min)

Timeline (from the Inquiry Board report)

  • Countdown: launch held at H0−7 min because visibility criteria weren't met; conditions improved as forecast.
  • H0 = 09:33:59 local time (12:33:59 UT), 4 June 1996: ignition of the Vulcain engine and two solid boosters; lift-off nominal.
  • Up to H0 + 36 s: nominal behaviour.
  • ~H0 + 36.7 s: the backup Inertial Reference System fails, followed immediately by the active one.
  • Shortly after: the solid boosters' nozzles swivel to their extreme position, then the Vulcain engine's, and the launcher veers abruptly.
  • ~H0 + 37 s onward: the vehicle breaks up; self-destruction is "correctly triggered by rupture of the links between the solid boosters and the core stage." It occurred at about 4,000 m altitude near the pad, scattering debris over about 12 km² of mangrove swamp and savanna.
  • Telemetry was received on the ground until H0 + 42 s. Investigators recovered both SRIs from the debris, and the active unit's data proved very helpful.

Root cause chain

  1. Inherited requirement: the alignment function kept running for about 40 seconds after lift-off. That was an Ariane 4 requirement; on Ariane 5 it "served no purpose after lift-off."
  2. Unchecked assumption: the possible range of BH was never explicitly quantified for Ariane 5. A 16-bit range was assumed.
  3. Missing protection: only four of seven variables were protected against operand overflow, to stay within an 80% CPU workload target.
  4. Specification: "in the event of any detected exception the processor was to be stopped." The supplier followed the spec.
  5. Common-mode failure: both SRI units ran the same software, so both stopped.
  6. Misinterpreted output: diagnostic data was treated as attitude data.

Testing gaps

The Inquiry Board (chaired by Jacques-Louis Lions) found that the SRI specification and equipment-level tests "did not specifically include the Ariane 5 trajectory data," so the realignment function was never tested under simulated Ariane 5 flight conditions. System simulations used simulated SRI output, not the real unit. "Had the system been included, the failure could have been detected." Post-flight simulations with the real software and actual trajectory data reproduced the failure exactly.

Key quotes

"The exception which occurred was not due to random failure but a design error. The exception was detected, but inappropriately handled because the view had been taken that software should be considered correct until it is shown to be at fault."

"There is reason for concern that a software exception should be allowed, or even required, to cause a processor to halt while handling mission-critical equipment."

Aftermath

The payload, four Cluster satellites for magnetosphere research, was lost; replacement Cluster II satellites launched on Soyuz rockets in 2000. Static analysis of the Ariane code (written in Ada) afterwards is described as the first large-scale use of abstract interpretation. Wikipedia puts the loss at more than US$370 million.

Keep reading to the end to earn XP.Read. XP earned.

Failure replay

Step by step, what broke and what it hit next.

  1. Design time
    Ariane 4 codehealthy

    Navigation software from Ariane 4 is reused. It assumes horizontal velocity values that fit into 16 bits.

    Affects: Inertial Reference (active), Inertial Reference (backup)

  2. H0
    Launcherhealthy

    Lift-off at 09:33:59 local time. Engines and boosters perform nominally.

  3. H0 + 30 s
    Inertial Reference (backup)degraded

    An alignment function that is useless after lift-off is still running. Its BH value climbs past anything Ariane 4 ever produced.

  4. H0 + 36.7 s
    Inertial Reference (backup)down

    Converting BH from a 64-bit float to a 16-bit integer overflows. Per spec, the processor halts.

    Affects: Inertial Reference (active)

  5. H0 + 36.7 s
    Inertial Reference (active)down

    The active unit runs identical code on identical data. It fails the same way immediately after.

    Affects: On-board computer

  6. H0 + 37 s
    On-board computerfailing

    It reads the failed unit's diagnostic bit pattern as real flight data and commands full nozzle deflection.

    Affects: Launcher

  7. H0 + 37 s
    Launcherfailing

    The rocket veers sharply. Angle of attack exceeds 20 degrees and aerodynamic forces start tearing it apart.

  8. H0 + ~39 s
    Launcherdown

    Self-destruct triggers correctly at about 4,000 m. Debris falls over 12 km² near the pad.

Impact

Who was affected
The maiden Ariane 5 flight and its payload of four ESA Cluster science satellites.
How long
About 37 seconds from lift-off to loss of the vehicle; Ariane 5 was not recognised as reliable as Ariane 4 until 2007.
Cost
More than US$370 million (per Wikipedia's summary of reporting).

Lessons

  • Reused code carries the assumptions of its old environment; re-validate ranges and requirements for the new one.
  • Turn off code that has no purpose in the current phase. The fatal function only mattered before lift-off.
  • "Halt on any exception" can turn a recoverable fault into a total failure; prefer degrading gracefully with best estimates.
  • Identical redundant units fail together on a software bug. Redundancy needs diversity to help.
  • Test with the real component and real operating data, not simulated outputs.

Quiz

  1. What operation caused the exception in Ariane 5's navigation software?

    Check answer

    Converting a 64-bit floating point value to a 16-bit signed integer. The BH (Horizontal Bias) value was too large to fit into a 16-bit signed integer, causing an operand overflow exception.

  2. Why didn't the backup Inertial Reference System save the flight?

    Check answer

    It ran the same software on the same data and failed for the same reason. The backup failed first and the active unit immediately after. Identical software means a common-mode failure.

  3. Why was the alignment function still running after lift-off?

    Check answer

    A requirement inherited from Ariane 4 kept it running for about 40 seconds. The function served no purpose after lift-off on Ariane 5, but an Ariane 4 requirement kept it active for about 40 seconds of flight.

  4. Which testing gap did the Inquiry Board highlight?

    Check answer

    Tests did not include Ariane 5 trajectory data, and system simulations used simulated SRI output instead of the real unit. The board said that including the real inertial system in simulation could have detected the failure. Post-flight simulations reproduced it exactly.

Interview prep

Try answering out loud before you open the model answer.

  1. debugging

    Explain how an integer overflow can bring down a system that has full hardware redundancy, using Ariane 5 as the example.

    Show model answer

    Ariane 5 converted a 64-bit float to a 16-bit signed integer. On Ariane 5's trajectory the value exceeded the 16-bit range, which raised an exception. The specification said to halt on any exception, so the navigation unit stopped. The redundant unit ran the same code with the same inputs, so it overflowed too. Hardware redundancy protects against random, independent faults; a design error is deterministic and common-mode. The fix is range analysis of every conversion, saturation or explicit handling instead of halting, and diversity where you rely on redundancy.

    A strong answer hits:

    • Narrowing conversion overflow (64-bit float to 16-bit int)
    • Halt-on-exception policy turned an error into a total loss
    • Common-mode failure defeats identical redundancy
    • Range analysis and graceful degradation as fixes
  2. system design

    You're designing error handling for a safety-critical component. When should it fail-stop, and when should it keep running in a degraded mode?

    Show model answer

    Fail-stop makes sense when wrong output is worse than no output and something downstream can take over safely. For a component whose output is essential, like attitude data during flight, stopping removes the only source of truth. Better options are to keep providing a best estimate, clamp values, or flag outputs as low confidence. Downstream consumers must also be able to tell "error" from "data". Ariane's on-board computer treated a diagnostic pattern as flight data, so the interface itself needs a validity signal.

    A strong answer hits:

    • Choose fail-stop vs fail-operational based on consequences
    • Essential outputs should degrade, not vanish
    • Explicit validity or health flags on interfaces
    • Never let diagnostics be mistaken for data
  3. behavioural

    Tell me how you would approach reusing a well-proven component from an older system in a new product.

    Show model answer

    "Proven" only means proven under the old conditions. I'd list the component's implicit assumptions (input ranges, timing, load, required behaviours) and check each against the new system. I'd remove or disable features the new system doesn't need, because unused code still runs and can still fail. Then I'd test it with the new system's real data and in integration, not just with stubs. Ariane 5's reused alignment code was never tested with Ariane 5 trajectory data.

    A strong answer hits:

    • Proven in the old context is not proven in the new one
    • Inventory and re-check implicit assumptions
    • Remove unneeded functionality
    • Integration testing with real data

Go deeper