Comment On Classic WTF: The Bug That Shut Down Computers World-Wide

The Bug That Shut Down Computers World-Wide was originally published on October 2nd, 2007, and today marks the twenty-fifth anniversary of the story. Here’s to a great 2009! [expand full text]
« PrevPage 1 | Page 2Next »

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 00:33 • by jmroth
Fist of teh year

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 00:50 • by ckd (unregistered)
Apparently all the old Wang VS programmers went on to the Zune software team.

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 01:20 • by ITEric (unregistered)
WOW! I don't think I've even SEEN a Wang since then. Was that what happened to them then?

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 02:29 • by Andy Goth
And we've been living on borrowed time ever since.

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 02:36 • by merichar (unregistered)
> Specifically, it mistakenly incremented the zero-indexed day-of-year
> for all day-of-years that are equal to 0 in a leap-year.

I may be misinterpreting the bug, but if it only incremented day-of-year 0 of a leap year, e.g. 1/1/1984, and did not increment any other day-of-year, couldn't this problem have been temporarily solved by waiting until day-of-year 1, e.g. 1/2/1984?

On 1/2/1984 the temporary files generated would have expiration dates equal to the current date and the temporary files generated on 1/1/1984, with their expiration dates of 1/2/1984, could also be removed without raising an error.

I suppose I'm just wondering why they sprung for overnight shipping, getting it there on the 2nd, when they had four years to send out the patch.

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 03:01 • by lolwtf
Hehe, wang.

Whatever became of this programming language "so simple a secretary could master it"?

Zune bug

2009-01-01 03:29 • by Kender (unregistered)
Here's the Zune bug:

BOOL ConvertDays(UINT32 days, SYSTEMTIME* lpTime)
{
int dayofweek, month, year;
UINT8 *month_tab;

//Calculate current day of the week
dayofweek = GetDayOfWeek(days);

year = ORIGINYEAR;

while (days > 365)
{
if (IsLeapYear(year))
{
if (days > 366)
{
days -= 366;
year += 1;
}
}
else
{
days -= 365;
year += 1;
}
}

http://pastie.org/349916

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 05:11 • by Wang (unregistered)
No post about Wangs is complete without a link to Freezepop's song - Do you like my Wang

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 06:07 • by Patrick Lin (unregistered)
Ironic that the Zune bug is also because of a programming oversight on a leap year.

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 06:29 • by configurator (unregistered)
So the zune bug would cause an infinite loop when days is 366 on a leap year?

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 07:25 • by m0ffx
237131 in reply to 237120
merichar:
> Specifically, it mistakenly incremented the zero-indexed day-of-year
> for all day-of-years that are equal to 0 in a leap-year.

I may be misinterpreting the bug, but if it only incremented day-of-year 0 of a leap year, e.g. 1/1/1984, and did not increment any other day-of-year, couldn't this problem have been temporarily solved by waiting until day-of-year 1, e.g. 1/2/1984?

On 1/2/1984 the temporary files generated would have expiration dates equal to the current date and the temporary files generated on 1/1/1984, with their expiration dates of 1/2/1984, could also be removed without raising an error.

I suppose I'm just wondering why they sprung for overnight shipping, getting it there on the 2nd, when they had four years to send out the patch.

The bug had flooded the storage with dud temporary files. The wangs were unable to boot with no storage. Presumably they had to overnight some means to free it up, say a deletion program that ran bare-metal and didn't try to write anything (or even extra storage).

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 08:54 • by Shmork (unregistered)
What strikes me as odd is that for all of these date-related problems, nobody ever tried setting the system date ahead or to a leap year or anything else. But I guess until you see something fail spectacularly, you don't worry about it much. Though I wonder if the Zune fiasco will change that—that's some pretty awful publicity.

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 09:01 • by Jamesface (unregistered)

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 09:05 • by Lupus.Umbrae (unregistered)
There were three big rages back in the 1980’s: Rubik’s cubes, Molly Ringwald, and Wangs. While I’m sure you are all familiar with those(...)


So, who the hell is/was Molly Ringwald?





Also, happy new year to everyone!

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 09:25 • by Someone Important (unregistered)
237137 in reply to 237134
Shmork:
What strikes me as odd is that for all of these date-related problems, nobody ever tried setting the system date ahead or to a leap year or anything else. But I guess until you see something fail spectacularly, you don't worry about it much. Though I wonder if the Zune fiasco will change that—that's some pretty awful publicity.


Well, if 'it works', why test it further? After all, time == money...

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 09:46 • by sluq (unregistered)
"grinded"?

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 10:07 • by pjt33
Why would the temp file module need to do any arithmetic in the first place? Just set the file expiration time to now() and you're sorted. The impression I get from the article is that it was taking now(), converting it to YYYY-MM-DDTHH:MM:SS and then converting it back. Is that correct?!

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 10:12 • by Nunja Business (unregistered)
237143 in reply to 237139
sluq:
"grinded"?


Thank you.

Captcha: secundum - when just one trojan isn't enough?

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 11:21 • by Daniel Beardsmore
237145 in reply to 237136
Lupus.Umbrae:
There were three big rages back in the 1980’s: Rubik’s cubes, Molly Ringwald, and Wangs. While I’m sure you are all familiar with those(...)


So, who the hell is/was Molly Ringwald?





Also, happy new year to everyone!

You know, looks like you answered your own question there.

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 12:04 • by ATimson
237149 in reply to 237134
Shmork:
What strikes me as odd is that for all of these date-related problems, nobody ever tried setting the system date ahead or to a leap year or anything else.

The article makes it sound like it's only a problem on 1 January <leapyear>. So while they probably tried and tested against the leap day proper, and the days around it, they wouldn't have noticed anything on those other 365 days.

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 13:25 • by Steeldragon
237153 in reply to 237149
Interesting WTF.

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 13:27 • by Crash Magnet (unregistered)
237154 in reply to 237137
Someone Important:
Shmork:
What strikes me as odd is that for all of these date-related problems, nobody ever tried setting the system date ahead or to a leap year or anything else. But I guess until you see something fail spectacularly, you don't worry about it much. Though I wonder if the Zune fiasco will change that—that's some pretty awful publicity.


Well, if 'it works', why test it further? After all, time == money...


and

knowledge == power...

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 14:47 • by dkf
237155 in reply to 237154
Crash Magnet:
knowledge == power
That omits a few important steps in between...

knowledge == academia
academia == gas-bag
gas-bag == wind
wind == electrical generation
electrical generation == power

See? It's obvious!

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 14:51 • by Dirk Diggler (unregistered)
237156 in reply to 237154
Crash Magnet:
Someone Important:
Shmork:
What strikes me as odd is that for all of these date-related problems, nobody ever tried setting the system date ahead or to a leap year or anything else. But I guess until you see something fail spectacularly, you don't worry about it much. Though I wonder if the Zune fiasco will change that—that's some pretty awful publicity.


Well, if 'it works', why test it further? After all, time == money...


and

knowledge == power...
Sorry can't help myself.

Chung Mee: Opium is my business. The bridge mean more traffic. More traffic mean more money. More money mean more power.
Lawrence Bourne III: Yeah, well, before I commit any of that to memory, would there be anything in this for me?
Chung Mee: Speed is important in business. Time is money.
Lawrence Bourne III: You said opium was money.
Chung Mee: Money is Money.
Lawrence Bourne III: Well then, what is time again?

Re: Zune bug

2009-01-01 15:04 • by WTF (unregistered)
237157 in reply to 237125
Kender:
Here's the Zune bug:

BOOL ConvertDays(UINT32 days, SYSTEMTIME* lpTime)
{
int dayofweek, month, year;
UINT8 *month_tab;

//Calculate current day of the week
dayofweek = GetDayOfWeek(days);

year = ORIGINYEAR;

while (days > 365)
{
if (IsLeapYear(year))
{
if (days > 366)
{
days -= 366;
year += 1;
}
}
else
{
days -= 365;
year += 1;
}
}

http://pastie.org/349916

Now why the heck would you put that inside of a while loop? That's just begging for a screw-up and an infinite loop. Wow.

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 15:08 • by John MAosn (unregistered)
Wow, I would have to say that is one crazy bug!

jess
www.privacy.es.tc

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-01 21:08 • by Dan (unregistered)
237168 in reply to 237114
ckd:
Apparently all the old Wang VS programmers went on to the Zune software team.


Actually, the buggy code that locked up the Zunes is from Freescale. (It's part of their clock driver) I can only assume that there are other devices out there suffering from a similar problem.

Re: Zune bug

2009-01-01 21:26 • by Harry (unregistered)
237169 in reply to 237157
It is made by Microsoft, you know ;)

Re: Zune bug

2009-01-01 22:11 • by jimlangrunner
237171 in reply to 237125
Kender:
Here's the Zune bug:

BOOL ConvertDays(UINT32 days, SYSTEMTIME* lpTime)
{
int dayofweek, month, year;
UINT8 *month_tab;

//Calculate current day of the week
dayofweek = GetDayOfWeek(days);

year = ORIGINYEAR;

while (days > 365)
{
if (IsLeapYear(year))
{
if (days > 366)
{
days -= 366;
year += 1;
}
}
else
{
days -= 365;
year += 1;
}
}

http://pastie.org/349916

Had to run that through my "code review module" a couple of times. (Hey - it's New Year's Day.) "1" and "60" work just fine. What could go wrong? Then I plugged in "365" and saw day 0 pop out. Ouch. I feel for the code review team that missed that.

Re: Zune bug

2009-01-01 23:59 • by guest (unregistered)
237174 in reply to 237171
[quote user="jimlangrunner]Had to run that through my "code review module" a couple of times. (Hey - it's New Year's Day.) "1" and "60" work just fine. What could go wrong? Then I plugged in "365" and saw day 0 pop out. Ouch. I feel for the code review team that missed that.[/quote]

I think the bigger problem is that IsLeapYear is true and yesterday was day 366.

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-02 00:08 • by Counsel (unregistered)
237175 in reply to 237168
Dan:
Actually, the buggy code that locked up the Zunes is from Freescale. (It's part of their clock driver) I can only assume that there are other devices out there suffering from a similar problem.
No, look at Microsoft's comments at the top of the file. If Freescale didn't accept Microsoft's EULA, Freesoft isn't authorized to use Freescale's source code. Neither can any other device makers.

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-02 02:19 • by rast (unregistered)
237179 in reply to 237136
Lupus.Umbrae:
So, who the hell is/was Molly Ringwald?



"Yes, you're a total fag."

Re: Zune bug

2009-01-02 02:38 • by Code reading is a skill (unregistered)
237180 in reply to 237157
Reading the code, it appears the reason it's in a while loop is that "days" can continue accumulating indefinitely while the device is off.

The while loop allows them to increase the number of years by the appropriate amount even if it has been off for a prolonged time, such as several years.

I'm not seeing a much simpler way to implement this than this while loop. You can't exactly just use integer division here. I don't think using "while" is the WTF. It's just a bug.

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-02 08:52 • by Wyrd (unregistered)
please s/grinded/ground/ in above article.

Ah, the Wang. Yeah, I've almost never heard of it before except in the Do It Yourself song:
"Oh, IBM, DEC, and Honnywell, HP, DG, and Wang / Amdahl, NEC, and NCR, they don't know anything. They make big bucks for systems so they never want it known that you can build a mainframe from the things ya find at home."

http://www.bsutton.com/Bill/Filk/diyAnnotated.txt

--
Furry cows moo and decompress.

wrong date

2009-01-02 09:05 • by Slackmaster K (unregistered)
Yesterday did not mark the anniversary of "October 2nd, 2007"

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-02 09:54 • by tgape
237191 in reply to 237134
Shmork:
What strikes me as odd is that for all of these date-related problems, nobody ever tried setting the system date ahead or to a leap year or anything else. But I guess until you see something fail spectacularly, you don't worry about it much. Though I wonder if the Zune fiasco will change that—that's some pretty awful publicity.


Well, some of us *do* think to test our code with leap years. Some of us even go so far as to test our code with Dec 31, the year before a leap year, and the first and last day of every month in the leap year, and Jan 1 of the year after the leap year. Others of us go even more pedantic and write an automated test loop that will test every day in the leap year.

Obviously, these bugs happen to people who don't do this.

Of course, then there's my coworker who wrote an automated test loop that tested every day in 2000... Sigh. (And, yes, his code did have a leap year bug.)

Re: wrong date

2009-01-02 09:59 • by tgape
237192 in reply to 237190
Slackmaster K:
Yesterday did not mark the anniversary of "October 2nd, 2007"


It wasn't the anniversary of the story being posted - it was the anniversary of the story itself.

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-02 10:11 • by bramster (unregistered)
Worked on a Wang back then. . . Whenever new software was being acquired, the first question the software salesman would ask is "How big is your Wang?"


Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-02 11:42 • by wintermute (unregistered)
237197 in reply to 237136
So, who the hell is/was Molly Ringwald?


Let me Google that for you...

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-02 12:03 • by z0iid (unregistered)
237198 in reply to 237197
i like that. learned something new.

Re: Zune bug

2009-01-02 12:52 • by Code Slave
237200 in reply to 237174
[quote user="guest"][quote user="jimlangrunner]Had to run that through my "code review module" a couple of times. (Hey - it's New Year's Day.) "1" and "60" work just fine. What could go wrong? Then I plugged in "365" and saw day 0 pop out. Ouch. I feel for the code review team that missed that.[/quote]

I think the bigger problem is that IsLeapYear is true and yesterday was day 366.[/quote]

Yes, 365 breaks out of the loop, but 366 doesn't, and on a leap year, there is no way to decrement days.

I suppose the way to fix it is collapse the two 'if's into

if (IsLeapYear(year)
&& (days > 366))

Then again, they should be working today again anyway.

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-02 13:01 • by operagost
237201 in reply to 237156
Dirk Diggler:

Chung Mee: Opium is my business. The bridge mean more traffic. More traffic mean more money. More money mean more power.


There were three big rages back in the 1980’s: Rubik’s cubes, Molly Ringwald, and Wangs.

... and Wang Chung! (Thanks, Diggler)

P.S. everybody have fun tonight

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-02 13:36 • by Ray Tackett (unregistered)
I worked for Wang in those days -- on the VS from 1976 to 1987. The bug first occurred in 1976 on the LAST (366th) day of a leap year. It botched the file's expiration date such that you could not delete a file which had not "yet" expired.

They swore it was fixed for 1980. It wasn't. It occurred again in 1984 and yet again at the end of 1988. Knowledgable system administrators ("system operators" back then) would set the date back to 30 December on the 31st, then reset it correctly on 1 January of the following year.

Wang Laboratories was dissolved completely in the mid-90s.

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-02 13:42 • by hamBone
237206 in reply to 237191
Once again we see the importance of boundary classes in testing. Testing every date in a specific year (or multiple years) is sometimes impossible, almost always unneccesary, and will surely kill ROI. It is much easier to find the end-points(New Year's) or known trouble spots (Feb 29), and then test n+1 and n-1.

When you consider that this is a basic lesson one learns when they begin QA, and take into account how many headaches developers have been through with datesin general, it's really a no-brainer.

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-02 13:51 • by hamBone
237207 in reply to 237206
It is much easier to find the end-points(New Year's) or known trouble spots (Feb 29), and then test n+1 and n-1.

...and n, of course. Sorry, I need to unit test my comments.

History Repeats itself...

2009-01-02 13:51 • by ChiefCrazyTalk (unregistered)
237208 in reply to 237113
Can anyone say...Zune, and the Z2K9 bug?

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-02 15:11 • by Lupus.Umbrae (unregistered)
Well, next time I ask a completely stupid question such as "Who is Molly Ringwald?" I will use <irony> or <trollmode> tags, okay?

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-02 15:22 • by Andy (unregistered)
237213 in reply to 237134
Shmork:
What strikes me as odd is that for all of these date-related problems, nobody ever tried setting the system date ahead or to a leap year or anything else. But I guess until you see something fail spectacularly, you don't worry about it much. Though I wonder if the Zune fiasco will change that—that's some pretty awful publicity.


We have been hit with some date related issues. Its not just leap year, we found some other magic dates over time that cause problems. Nothing like that early morning call that Tokyo started trading and the whole system is down and every customer is calling. Fix it now.

I have suggested to our QA team that they run with the dates in one lab set 3 months ahead. Call it the future lab. That way, if we hit a strange date related problem we have three months before all the customers call us.

No, they don't do it.

Re: Zune bug

2009-01-02 15:51 • by Capt. Obvious (unregistered)
237214 in reply to 237200
Code Slave:
I suppose the way to fix it is collapse the two 'if's into
[code]
if (IsLeapYear(year)

&& (days > 366))

Well, that would have the effect of breaking in a non-infinite loop way in leap years. The calander would still go Dec. 29, Dec. 30, Jan. 1, Jan. 1 at end of a leap year/start of the next year.

Re: Classic WTF: The Bug That Shut Down Computers World-Wide

2009-01-02 16:32 • by BoredAtWork (unregistered)
237215 in reply to 237191
Shmork:


...

Of course, then there's my coworker who wrote an automated test loop that tested every day in 2000... Sigh. (And, yes, his code did have a leap year bug.)

Am I missing something here? That sounds like a *good* way to catch a leap year bug.
« PrevPage 1 | Page 2Next »

Add Comment