The zune bug mentioned in the previous post was caused by a missing break statement. There was an interesting incident which had happened on January 15th, 1990, caused by the insertion of a break statement at the wrong place in the, C code. I have read about this bug in the book “Expert C Programming – Deep C secrets – Peter Vander Linden“. The following is the excerpt from the book which explains it.
This is a replica of the code that caused a major disruption of AT&T phone service throughout the U.S. AT&T’s network was in large part unusable for about nine hours starting on the afternoon of January 15, 1990. Telephone exchanges (or “switching systems” in phone jargon) are all computer systems these days, and this code was running on a model 4ESS Central Office Switching System. It demonstrates that it is too easy in C to overlook exactly which control constructs are affected by a “break” statement.
network code()
{
switch (line) {
case THING1:
doit1();
break;
case THING2:
if (x == STUFF) {
do_first_stuff();
if (y == OTHER_STUFF)
break;
do_later_stuff();
} /* coder meant to break to here... */
initialize_modes_pointer();
break;
default:
processing();
} /* ...but actually broke to here! */
use_modes_pointer();/* leaving the modes_pointer
uninitialized */
}
This is a simplified version of the code, but the bug was real enough. The programmer wanted to break out of the “if” statement, forgetting that “break” actually gets you out of the nearest enclosing iteration or switch statement. Here, it broke out of the switch, and executed the call to use_modes_pointer() —but the necessary initialization had not been done, causing a failure further on. This code eventually caused the first major network problem in AT&T’s 114-year history. The saga is described in greater detail on page 11 of the January 22, 1990 issue of Telephony magazine. The supposedly fail-safe design of the network signaling system actually spread the fault in a chain reaction, bringing down the entire long distance network.
And it all rested on a C switch statement!!!!.
The Practice of Programming advice - Zune bug | CH Gowri Kumar's blog says:
[...] Syntaxhighlighter Hello World! AT&T “break” bug [...]
January 6, 2009, 11:53 pmRantings and Ramblings From All Around.. » Blog Archive » At&T “Break” Bug | Ch Gowri Kumar’s Blog says:
[...] The zune bug mentioned in the previous post was caused by a missing break statement. There was an interesting incident which had happened on January 15th,[Continue Reading] [...]
January 8, 2009, 8:23 pm