Hello w0rld


The purpose of this blog is to write about my work as a developer in
the Windows Serviceability organization, more specifically in the
Client Platform team. My org’s main responsibility is fixing bugs in
the currently released version of Windows, currently Vista and Server
2008. My team’s focus areas include printing, scanning, the graphics
platform, shell, input methods, timezones, multimedia, application
compatibility. But enough about me 🙂

I thought it would be
a good idea to start this blog with an entry people could relate to,
a bug people would be already familiar with even if it doesn’t fall under my team’s ownership. So I’m going to talk
about the Zune 30 GB bug, often referred to as Z2K. On December 31st
2008, all/most 30 GB Zune with recent firmware became frozen. The bug
is that during the boot sequence, the current date and time is checked.
The date is stored as the number of days that have elapsed since Jan 1,
1980.

As you can see in the code snippet below (taken from
http://www.zuneboards.com/forums/zune-news/38143-cause-zune-30-leapyear-problem-isolated.html) it’s trying to determine the year and day-of-year from the number of days elapsed since 1980. The problem is that when you’re in the 366th day of a leap year, we don’t go into the inner if so we don’t subtract 366, and keep going into the while block forever. Since this code runs at boot time, your device is now unbootable (well…until Jan 1st 2009 anyway).

 
 

year = ORIGINYEAR; /* = 1980 */

 

while (days > 365)

{

    if
(IsLeapYear(year))

    {

       
if (days > 366)

       
{

           
days -= 366;

           
year += 1;

       
}

    }

    else

    {

       
days -= 365;

       
year += 1;

    }

}

Skip to main content