Zune Bug explained

On new year eve, All Microsoft Zune players freezed, becoming totally unresponsive and practically useless.

“In what appears to be the biggest worldwide device failure in consumer electronics history, tens of thousands of owners of Microsoft’s Zune turned on the music player Wednesday morning only to discover it was the day the music died. By early afternoon, Microsoft released a statement saying the problem, which affected the original 30-gigabyte model of the Zune that first went on sale in September 2006, was solved. The issue: a bug in the way the gadget’s internal clock handles a leap year.”

The problem was in a small part of code in Zune’s clock driver which resulted in Zune looping forever.

Zune Failing :
http://gizmodo.com/5121311/reports-30gb-zunes-failing-everywhere-all-at-once
http://www.mercurynews.com/ci_11345379

Cause : (Zune bug explained here )
Bug in code ( Not taking leap year into account properly, seems simple ?)

Part of a function :

————————————————————–


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

————————————————————–

Bugs:

1) It should be days==366 or days>=366
2) No else condition mentioned for nested if. (Should have been there specially when if is inside a while loop )

Now Zune will keep looping forever. Zune bug explained here

Microsoft response : http://www.zune.net/en-us/support/zune30.htm
This is big reputational risk for Microsoft’s Zune, when it trying hard to stand against Apple’s Ipod.