I was hesitating to ask this, since it seems very easy.
What is wrong in this pseudocode?
In the switching software (written in C), there was;
- a long “do… while” construct, which contained
- a “switch” statement, which contained
- an “if’ clause, which contained
- a “break,” which was intended for the “if” clause
- but instead broke from the “switch” statement.
This caused a crash of the telephone system in 1990
(See: http://users.csc.calpoly.edu/~jdalbey/SWE/Papers/att_collapse.html).
I need a very simple, explanation, why this code is wrong. I think the most simple answer is that within a if clause a break is not possible? So what statement needs to be written instead of a break within a if clause for getting the wanted effect, which is breaking the if clause?
I suspect that the description / pseudo-code is incorrect when it says:
a "break," which was intended for the "if" clauseIt would make sense if that was meant to be:
break, which was intended to terminate thedo whileloopThe problem description then makes sense.
Reading the URL referenced in the question, the pseudo-code there is:
This agrees with my hypothesis – the pseudo-code in the question is an incorrect characterization of the pseudo-code in the paper.Another reference on the same subject (found via a Google search ‘att crash 1990 4ess’) says:
Apparently, the programmer really did just think that
breakwould end theifstatement; it was a small mental blackout that led to a large real-world blackout.