On CBS MoneyWatch: 6 big myths about gas mileage
BNET Business Network:
BNET
TechRepublic
ZDNet

January 12th, 2009

The cause behind the Zune's "New Year's Eve" mass suicide

Posted by Adrian Kingsley-Hughes @ 1:39 pm

Categories: Peripherals, Software

Tags: Microsoft Zune, Code, Suicide, Adrian Kingsley-Hughes

Ed Felton writing onĀ Freedom to Tinker takes a look at the reason behind the Zune’s “New Year’s Eve” mass suicide.

On December 31, 2008, starting with days=10592 and years=1980, the code would eventually reach the point where days=366 and year=2008, which means (correctly) that 366 days had elapsed since January 1, 2008. To put it another way, it was the 366th day of 2008.

This is where things went horribly wrong. The code decided it wasn’t time to stop yet, because days was more than 365. (”while (days > 365)”) It then asked whether year was a leap year, concluding correctly that 2008 was a leap year. (”if (IsLeapYear(year))”) It next determined that days was not less than 366 (”if (days < 366)“), so that no arithmetic should be performed. The code had gotten stuck: it couldn’t stop, because days was greater than 365, but it couldn’t make progress, because days was not less than 366. This section of code would keep running forever — leaving the Zune seemingly dead in the water.

This is a very interesting example of how a small error in code can have a massive effect.

Adrian Kingsley-HughesAdrian is a technology journalist and author who has devoted over a decade to helping users get the most from technology. He also runs a popular blog called The PC Doctor. See his full profile and disclosure of his industry affiliations

Want to get in touch? Got a tip? Feel free to drop me a note! I ALWAYS respect anonymity. I'm also on Twitter (@the_pc_doc)

Right to Reply: Should any industry representatives wish to comment on any posts on Hardware 2.0, I will be happy to publish their reply verbatim on this blog.

Subscribe to Hardware 2.0 via Email alerts or RSS.

  • Talkback
  • Most Recent of 9 Talkback(s)
It's really consistent..
With what we are used to with MS products. Did you hear that one of the XBOX destroying CD's?

They cut the prices of those things yet again.. And still the Wii is sold out most at almost the d... (Read the rest)
Posted by: TedKraan Posted on: 01/15/09 You are currently: a Guest | | Terms of Use
Suicide? More like 24hr Coma....  Gnutella | 01/12/09
Digg story with full source code  NonZealot | 01/12/09
MS verification process quality... sad  Solid Water | 01/12/09
RE: The cause behind the Zune's  chips@... | 01/13/09
Dumb users  WindowWasher | 01/13/09
Released and untested  mikecepek | 01/13/09
The cause?  andycher | 01/14/09
RE: The cause behind the Zune's  mkayzero | 01/14/09
It's really consistent..  TedKraan | 01/15/09

What do you think?

SponsoredWhite Papers, Webcasts, and Downloads

Click Here
advertisement

Recent Entries

advertisement

Archives

ZDNet Blogs

White Papers, Webcasts, and Downloads