News for hackers. Stuff that matters.
Re:Ask HN: What's the worst thing your code has done? by AnimalMuppet on Monday July 17, 2017 @07:08PM (#14793049)
We had a microwave generator that was used to cook cancers in living patients. We'd ask for a given power, and we had the ability to read back how much power we actually got. But we didn't check that the power we read back was something reasonable. When an op amp failed, the generator produced full power whenever we asked for any power at all. The patient literally got hot enough to emit smoke.

Thank God, the patient was a pig. We hadn't made it into clinical use yet.

Re:Ask HN: What's the worst thing your code has done? by CapacitorSet on Monday July 17, 2017 @08:04PM (#14793339)
>When an op amp failed, the generator produced full power whenever we asked for any power at all.

Huh, I'd expect sensitive systems like these to have some sort of hardware redundancy/voting system.

Re:Ask HN: What's the worst thing your code has done? by sjg007 on Monday July 17, 2017 @09:14PM (#14793663)
The therac system is well known.. hardware interlock.
Re:Ask HN: What's the worst thing your code has done? by kazinator on Tuesday July 18, 2017 @04:42PM (#14799892)
Although that is true, the point is that the software could have done something (in this particular failure case) since it had the means to monitor the actual power. Like "Oh shit, there is too much power; something is wrong; shut everything down".
Re:Ask HN: What's the worst thing your code has done? by ill0gicity on Monday July 17, 2017 @08:02PM (#14793328)
I'd been looking for a new way to roast whole hogs... My search has ended here.
Re:Ask HN: What's the worst thing your code has done? by Procrastes on Monday July 17, 2017 @07:20PM (#14793121)
Holy crap! That kind of failure (where some governing component drops out) is one of my favorite nightmares. Did you add an RF meter to the design?
Re:Ask HN: What's the worst thing your code has done? by AnimalMuppet on Monday July 17, 2017 @07:37PM (#14793223)
No. We added code that, if the power was too far off from what we asked for, tried to kill power three different ways, plus alerted the operator. It was a bit tricky, because the power is never exactly what you ask for (variable impedance match, plus noise).
Re:Ask HN: What's the worst thing your code has done? by wfunction on Monday July 17, 2017 @07:58PM (#14793318)
> We added code that, if the power was too far off from what we asked for, tried to kill power three different ways, plus alerted the operator.

My first worry was that your measurement would be wrong, not that the power wouldn't be killed! Any redundancy on that side? Or was it not necessary?

Re:Ask HN: What's the worst thing your code has done? by AnimalMuppet on Monday July 17, 2017 @08:29PM (#14793436)
The specific issue that we encountered was that the power was measured correctly, but was out of control. At that point, not being able to kill the power is a very real concern.

If we measured wrong, we could either be high or low. If we measured high (that is, the reading is higher than reality), we would either turn down the power until it read right, or else kill power completely. If we read low, though, IIRC we would limit how high we'd turn up the gain to try to get the power we were asking for.

There was also a feedback loop based on temperature. If the power was double what we asked for, the temperature would quickly climb, and we'd reduce power. It would have worked, even with inaccurate power readings, though not as smoothly as it should with accurate power readings. But when we got 20 times the power we asked for (due to the power control failure), it was too much too fast.

Re:Ask HN: What's the worst thing your code has done? by AstralStorm on Tuesday July 18, 2017 @01:04PM (#14798153)
Congratulations. You've found out there is value in having real programmable fuses instead of control electronics.
Re:Ask HN: What's the worst thing your code has done? by karthikb on Monday July 17, 2017 @09:02PM (#14793619)
Usually the failure mode in these kinds of system should be to emit nothing....
Re:Ask HN: What's the worst thing your code has done? by kazinator on Tuesday July 18, 2017 @04:40PM (#14799883)
Did the police show up?
Re:Ask HN: What's the worst thing your code has done? by AnimalMuppet on Wednesday July 19, 2017 @01:34PM (#14806116)
For a pig? No.
Re:Ask HN: What's the worst thing your code has done? by ohquu on Thursday July 20, 2017 @01:33AM (#14810216)
WOOSH