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

Ed Felton writing on Freedom to Tinker takes a look at the reason behind the Zune "New Year's Eve" mass suicide - how a simple code blunder can have a worldwide effect.
Written by Adrian Kingsley-Hughes, Senior Contributing Editor

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.

Editorial standards