~learn.
0:00 / 1:36
War story · Therac-25 · 1985–1987

The Therac-25 overdosed patients when its operator edited too fast

transcript

She fixed one typo. Her patient got a massive radiation overdose. The trigger? She was fast at her job.

Texas, 1986. The Therac-25, a radiation therapy machine. She types x, for X-ray. She meant e, for electron. Cursor up, fix it. Seconds. Beam on. The machine stops. Malfunction 54. The manuals don't explain it. The screen shows an underdose. So she presses P. Proceed.

A typical single dose is about 200 rads. AECL later measured 25,000. Three weeks on, a second patient was hit. Both men died.

The maker couldn't reproduce it. The hospital physicist could. The key was speed. Setting the beam's magnets takes about 8 seconds. Finish your edit inside that window, and the part that sets up treatment never notices. A race condition.

But here's the twist. A different bug struck in Yakima. Every pass added one to a variable. Zero meant skip the check. It was one byte. Every 256th pass, it rolled over to zero. Press set at that moment, and a full beam fires. Target out of place.

Older models had hardware interlocks. They physically blocked unsafe beams. The Therac-25 relied largely on software instead. Its bugs got through.

Safety in software alone is a single point of failure. Keep independent checks. And never use a counter as a yes or no.

Full story in the article.