Patriot at Dhahran: the clock that lost a third of a second
A missile defence computer lost a sliver of time every tenth of a second. After 100 hours, its radar looked in the wrong place, and a Scud got through. Run the clock yourself.
- Ref
- EP-03
- Date
- Module
- Post-Mortem Lab
- Source
- ep-03
▶ Watch · the episode
On 25 February 1991, during the Gulf War, an Iraqi Scud missile flew towards Dhahran, Saudi Arabia. A Patriot missile defence battery was there to shoot it down. It never fired. The Scud hit an Army barracks and killed 28 American soldiers.
The US General Accounting Office (GAO) investigated. The cause was the battery’s clock. It had been running for over 100 hours, and in that time it had fallen a third of a second behind. That was enough for the radar to look in the wrong place.
Run the clock
Press Run to fast-forward 100 hours of non-stop running. The box is where the radar looks; the arrow is where the missile really is. Then try restarting the battery, or switching on the corrected software.
- Clock behind by
- 0.0000 s
- Window moved
- 0 m
- Window off the missile
- 0%
- Radar
- tracking
What happened
Every step comes from the GAO’s report.
- Built for a few hours. The Patriot was designed to defend against aircraft in Europe and to move often, running “for only a few hours at one location”. It had never been used against Scuds before.
- Time as a count. The computer’s clock counted tenths of a second as a whole number: 1, 2, 3… To predict where the Scud would be next, it turned that count into seconds by multiplying by one tenth.
- One tenth doesn’t fit. In binary, one tenth is 0.000110011001100… repeating forever, the way one third is 0.333… in decimal. The computer held numbers in 24 binary digits and dropped the rest, so its “one tenth” was very slightly too small.
- The error grows. A tiny loss on every tick adds up. After one hour, the clock was 0.0034 seconds behind. After 8 hours, the search window had slid 20% off the target. At 50% or more, the Patriot won’t track a Scud, which happens after about 20 hours.
- Dhahran. The battery had been running for over 100 hours. Its clock was 0.3433 seconds behind, and the search window had moved 687 metres. The radar looked where the Scud wasn’t, so the battery never engaged it.
- Warnings that didn’t land. On 11 February, Israeli data showed the 20% slide after 8 hours. Restarting the battery, which takes 60 to 90 seconds, sets the clock back to zero. On 21 February, crews were warned that “very long run times” could shift the window, but not told what “very long” meant. Corrected software was released on 16 February. It reached Dhahran on 26 February, the day after the attack.
| Hours running | Clock behind by | Search window moved |
|---|---|---|
| 1 | 0.0034 s | 7 m |
| 8 | 0.0275 s | 55 m |
| 20 | 0.0687 s | 137 m |
| 100 | 0.3433 s | 687 m |
From the GAO report’s Appendix II. The simulation reproduces every row.
Fix it
| Fix | What changes |
|---|---|
| Restart every 8 hours | The clock never gets more than 55 m of slide; the Scud stays in the window |
| Restart once a day | Not enough: the window is lost after about 20 hours |
| Corrected software: work out the time without the loss | The clock stays right after 100 hours, with no restarts |
The restart is a workaround: it works only if everyone knows to do it, and how often. The real fix is in the
arithmetic. In the lab’s toolkit, chop(0.1, 23) shows the loss directly: one tenth comes back about 0.000000095 too
small.
What I simplified
The report describes the conversion but not the computer’s exact instructions. The simulation reduces it to one multiplication by a chopped one tenth, which reproduces the report’s clock errors to four decimal places. How far the window moves per second of error, and how big the window is, are taken from the report’s own figures (687 m at 0.3433 s, and a 20% slide after 8 hours). Later analyses, such as Robert Skeel’s in the reading list, argue the full story is subtler: the corrected conversion was used in some parts of the code but not others. That detail isn’t in the GAO report, so the simulation leaves it out.
Further reading
Primary sources first. Everything here is free to read or watch.
- ReportPatriot Missile Defense: Software Problem Led to System Failure at Dhahran, Saudi Arabia (IMTEC-92-26)US General Accounting Office, 1992
- ArticleRoundoff Error and the Patriot MissileRobert Skeel · SIAM News, July 1992
- ArticleThe Patriot Missile FailureDouglas N. Arnold · University of Minnesota
- VideoFloating Point Numbers (why 0.1 is hard for computers)Computerphile (YouTube)