ASTRACDE
Log inJoin
DRILL #02Severity: REDStatus: SELF-DESTRUCTED

Last Year's Speedometer

Real disaster: Ariane 5, Flight 501 (1996)

Voice note from Santa

β€œWho put last year's code in this year's sleigh? WHO? Blitzen is fine, by the way. Blitzen is very upset, but fine.”

1Incident briefing

🧝 From Byte, Chief Elf Engineer

We gave the test sleigh a brand-new turbo booster. We kept last year's speedometer code, because it worked fine last year.

A few seconds after takeoff the speedometer showed a huge negative number. The autopilot believed it, panicked, and flipped the sleigh.

Nobody was hurt. One reindeer would like a word.

2What really happened

On 4 June 1996, Europe's new Ariane 5 rocket lifted off for the first time. About 37 seconds later it swerved off course, started breaking apart and self-destructed. Four science satellites on board were lost.

The cause was code copied from the older, slower Ariane 4. One line took a speed reading and squeezed it into a small number box that can only hold values up to 32,767. On Ariane 4 the reading never got that high. Ariane 5 was much faster, so it did.

The box overflowed and the guidance computer crashed. Its backup ran the same code, so it crashed too. The main flight computer then read the crash message as if it were real flight data and steered hard.

The twist: that piece of code wasn't even needed once the rocket had left the ground.

3The lesson

Reused code brings its old assumptions with it.

When you reuse something somewhere new, re-check its limits and test it with the new conditions, not the old ones. And a backup running identical code isn't really a backup.

4The challenge

You can read everything, but you'll need to join the Elf Response Team (or log in) to submit answers and earn stars.

STAR 1 Β· FIX ITβ˜…

Fix it: when does it break?

The speedometer stores speed in a box that holds whole numbers up to 32,767.

At takeoff (second 0) the new sleigh reads 20,000. Every second it gets 1,500 faster.

At which second does the speed first go above what the box can hold?

A whole number (the second), e.g. 4

STAR 2 Β· PREVENT ITβ˜…

Prevent it: size the box

πŸ”’ Earn Star 1 to unlock this one.

TREE DECORATION

Overflow Rocket

Earn Star 1 to unlock it for your tree.

0 elves earned Star 1 so far. 3 more to restore uptime.

How was this drill?

We're testing the format. Be honest.

Join to leave feedback.