Mariner 1's $135 million software bug
An incorrectly encoded punch card helped to doom the Mariner 1 spacecraft in 1962. Would that bug have been easier to catch today?
These days, when software programmers write code, there are a variety of ways to catch typos, errors or bugs before a system goes into production. One of the simplest ways, though, is to just look at the code on a screen. This is an advantage that programmers who coded via punch cards obviously didn’t have back in the day.
In the punch card days, code would be translated to cards via a programmer or operator using a keypunch. Typos, or incorrect commands, couldn’t be caught by simply looking at what was typed on a screen. Often times, in order to check that information was input properly, it would be re-punched onto a second card that would then be compared to the first using a card verifier.
A bug introduced by a punch card turned out to be one of the most expensive software bugs in history, when it led to the destruction of the Mariner 1 spacecraft in 1962 (cost in 1962 dollars: $18.5 million; cost in today’s dollars: $135 million), before it could complete its mission of flying by Venus.
The Mariner 1 spacecraft was launched on July 22, 1962 from Cape Canaveral, Florida. Minutes into the flight, an onboard guidance antenna failed, which caused fallback to a backup radar system that should have been able to guide the spacecraft. However, there was a fatal flaw in the software of that guidance system: when the equations that would be used to process and translate tracking data into flight instructions were encoded onto punch cards, one critical symbol was left out: an overbar or overline, often confused in ensuing years with a hyphen. The lack of that overbar, essentially, caused the guidance computer to incorrectly compensate for some otherwise normal movement in the spacecraft. As the New York Times wrote days after the launch
The hyphen symbol, called a “bar,” if officially fed into the computer on its punched card instructions, in effect tells the machine not to worry about this normal veering movement.
The spacecraft landed up maneuvering in a way that it shouldn’t have and which put it on a path to crash, possibly into inhabited areas. For safety purposes, then, 293 seconds into the the mission it was destroyed on command.
Ultimately, it wasn’t only a software bug that led to the loss of the spacecraft. In fact, this same bug was present in earlier launches of the first two Ranger missions, upon which the Mariner 1 system was based, without causing a problem. It was only after the hardware failure of the guidance antenna that the flawed software came into play.
Nevertheless, the bug was a key reason for the loss of the spacecraft. Luckily, as the final project report indicated (see pages 13-14), the problems that doomed Mariner 1 were addressed in time for the launch of Mariner 2, which successfully completed the mission intended for Mariner 1, a fly-by of Venus, 50 years ago last week.
Would this bug have been caught earlier if the code had simply been reviewable on screen by a second set of eyes? We’ll never know, and I’m not suggesting this sort of thing couldn’t happen today (it still does, in fact). But, not knowing what systems NASA or JPL had in place 50 years ago to review and check the code, I wonder if the extra steps involved with verifying punch cards played a small role in not catching this bug.
What’s your take? Do you have experience coding via punch cards? Please share in the comments.