Slashdot Mirror


Microsoft Issues Workaround For Zune Freeze

UnknowingFool writes "As a followup to the Zune New Year's Eve meltdown, Microsoft has issued a workaround for what some users have correctly guessed was a bug caused by a leap year. To recover from the problem, let the Zune drain the batteries and restart it after noon on January 1, 2009. Many sites are reporting that Microsoft has 'fixed' the issue, but technically all Microsoft has done is to ask users to wait out the conditions that triggered the bug. Unless a software patch comes out, Zunes will suffer the same problem again in four years." Reader ndtechnologies adds, "According to posts in the Toshiba forum at anythingbutipod.com, the same bug that shut down millions of Zune 30's also affects the Toshiba Gigabeat S. The Zune 30 is based off of the Gigabeat S series and was co-developed by Microsoft with Toshiba."

47 of 277 comments (clear)

  1. It probably won't last another 4 years by thetoadwarrior · · Score: 5, Funny

    So this is an acceptable solution.

    1. Re:It probably won't last another 4 years by ccguy · · Score: 3, Insightful

      Besides, I know people who still have first generation iPods.

      And if they broke, would they expect apple to fix them?

      Suppose instead of this being Zune's firmware it was a microwave you bought 5 years ago. Would you have any claim to have it fixed (out of warranty, etc).

    2. Re:It probably won't last another 4 years by Tubal-Cain · · Score: 5, Insightful

      Microwaves do not lock up because of leap year issues.

    3. Re:It probably won't last another 4 years by datajack · · Score: 4, Insightful

      The difference being that microwaves suffer wear and tear and can develop a fault after five years.

      This is software, the fault was there when it was purchased.

    4. Re:It probably won't last another 4 years by mindwhip · · Score: 5, Informative

      The microwave failure would be acceptable wear and tear. The Zune was in effect sold with a predictable and correctable flaw (leap years are very predictable), causing it fail out with normal wear and tear, which would class it as defective product.

      In UK law at least this is a significant difference... you can never tell in the US though.

      --
      [The Universe] has gone offline.
    5. Re:It probably won't last another 4 years by Pentium100 · · Score: 5, Insightful

      You can get the microwave (or a tape recorder, or a VCR) fixed by a third party (or do it yourself) depending on what part has broken.

      Only Microsoft can fix these firmware issues. If the source code for the firmware was publicly available, someone could fix the problem and distribute the fixed firmware for free or for money, but since it isn't, only MS can patch it.

    6. Re:It probably won't last another 4 years by witherstaff · · Score: 5, Insightful

      Why are consumer electronics any different than any other product? Let's talk about items costing less than a laptop, so less than 2000.

      Would you accept if your 5 year old ___ broke , was unfixable, and needed a new replacement?

      • Home Furnace
      • Central Air
      • Oven
      • Refrigerator
      • Bike

      You get the picture. Why are electronic manufactures exempt from shoddy products that don't have some sort of reasonable lifespan? Not wear and tear or dropping a product, just the product becoming unusable due to the product having some bug/feature to break it outright like the Zune.

      As to a microwave, a 5 year old whirlpool oven broke on me and they no longer had replacement circuit boards. Whirlpool expects their products to have at least a 10 year lifespan. They pro-rated my equipment and sold a new unit, installed, for 33% of the cost. Now that's an acceptable solution for shoddy workmanship.

    7. Re:It probably won't last another 4 years by SimonTheSoundMan · · Score: 3, Informative

      If the microwave was only 5 years old and it broke down, you are covered in England and Wales by consumer protection laws if it less than six years old and it break down. Just as long as you can prove it was not accidental damage, your covered for a free repair. :)

      Just something for the UK readers here. Covers anything electronic.

    8. Re:It probably won't last another 4 years by mustafap · · Score: 4, Insightful

      >Why are electronic manufactures exempt from shoddy products that don't have some sort of reasonable lifespan

      Because collectively we accept this. Sad but true.

      --
      Open Source Drum Kit, LPLC deve board - mjhdesigns.com
    9. Re:It probably won't last another 4 years by Leif_Bloomquist · · Score: 4, Informative

      My microwave has a firmware bug. After I heat something, if the next button on the keypad I press is anything other than "Reset", it locks up. It's incredibly irritating (since I'm usually putting something else in and trying to enter a new cooking time). That said, the microwave cost under $50...

    10. Re:It probably won't last another 4 years by Paradise+Pete · · Score: 5, Insightful

      The Zune was in effect sold with a predictable and correctable flaw

      And if you look at the bug in the code (line 259) it's atrocious. Something a junior programmer would be embarrassed about.

      When days is 366 it causes an infinite loop. And also note that simply changing line 263 to use 365 causes a different bug. So the whole approach is wrong. It ought to simply be

      while (days > daysInYear(year))
      {
      days -= daysInYear(year);
      year += 1;
      }

    11. Re:It probably won't last another 4 years by Paradise+Pete · · Score: 2, Informative

      Why is it a loop anyway when it's only a one hit event?

      They start from 1980. You can see it on line 58.
      And looking at line 59 you can see that there is planned obsolescence(!) for the year 2080. Zune owners should demand a refund ;-)

    12. Re:It probably won't last another 4 years by Alex+Belits · · Score: 2, Insightful

      Because software does not wear out?

      --
      Contrary to the popular belief, there indeed is no God.
    13. Re:It probably won't last another 4 years by alvinrod · · Score: 2, Interesting

      I think that at least part of the reason we collectively accept this has a lot to do with the idea that these devices are generally obsolete are at least significantly out of date after five years. If refrigerators and bicycles were making the same kind of advances as these other products, most people honestly wouldn't care if they junked out in five years. If your fridge was doubling in performance every 18 months, wouldn't you want to get a new one every six years or so to take advantage of the cost savings?

      We're already starting to reach a point where the common user probably isn't putting their system to full use. In another few years, the baseline desktop models will probably have more than enough computational power to satisfy non-power users. Businesses running computationally heavy software will still need more power, but mom and pop won't even be able to scratch the surface of their eight core, eight gig RAM system with just office apps and email. At that point I can see people buying a desktop with the intention that it last for ten years or more.

      Of course this just shifts the battlefield to the netbook and cell phone segment where the performance gains are going to be more significant. Eventually the hardware will peak in this area as well and once again the market will find some new segment to rush after; probably some guy who figures out how to cram all of that functionality into a watch capable of projecting a 3D holograph which is used for a display. Then that'll be the new craze as no one really needs to upgrade their netbook to the new 32 core model with 16 TB of storage space.

      When the pace of technology is moving so fast that something becomes obsolete after five years anyhow, most people won't really care if it doesn't last much longer. A few might, but they're probably not in the majority. Add in our societies tendency to go after the product with the least cost upfront (regardless of whether or not it's a POS that will have to be replaced soon after purchase.) and that we're so willing to purchase replacements is it really any surprise the businesses have reacted to what the market seems to demand?

    14. Re:It probably won't last another 4 years by jc42 · · Score: 4, Informative

      It ought to simply be

      while (days > daysInYear(year))
      {
      days -= daysInYear(year);
      year += 1;
      }

      Hey, c'mon now; programmers are almost universally judged by their bosses by the number of lines of code they produce. The (buggy) MS code used 16 lines to do what you did in 5 lines. Therefore, the original (buggy) code is considered more than 3 times better than yours. No programmer interested in a good professional career would write code so simply and obviously correct.

      This isn't really a joke. One a project a few years ago, I fixed several bugs by doing rewrites like yours, resulting in fewer lines of code. My record actually had a note indicating that I had negative productivity during that period, and my superiors had a real problem giving me a good review because of it.

      Yes, I did find another job soon thereafter. But that wasn't the last time something like that happened.

      (And I would probably save the first call of daysInYear(year) in a local variable, which would make the code a bit faster. But I could declare the local on a separate line, incrementing the line count, so it would look good to the line counters. ;-)

      --
      Those who do study history are doomed to stand helplessly by while everyone else repeats it.
    15. Re:It probably won't last another 4 years by nizo · · Score: 2, Funny

      That's ok; since I am an American you could have used grams of fairy dust and it would have meant as much to me as pounds and pence.

    16. Re:It probably won't last another 4 years by jc42 · · Score: 3, Informative

      Nah; most code-size measurements exclude comments, on the grounds that comments aren't executed by the computer, and thus aren't code. This puts subtle pressure on the programmers to not write comments, since this just takes time that leads to being behind schedule.

      It's hard to imagine any rating system that's more screwed up than the system used in most companies to rate the output of their programmers. If they were consciously trying to sabotage the software, they probably wouldn't come up with any schemes nearly as effective as judging programmers by lines of code produced.

      --
      Those who do study history are doomed to stand helplessly by while everyone else repeats it.
    17. Re:It probably won't last another 4 years by sowth · · Score: 2, Insightful

      If I bought a microwave and it did that, I would probably never buy from the manufacturer again. Maybe if they apoligized for making such a crappy product and it was shown they now don't make defective products anymore. Though even then, if it was the exact same product as another mfg with the same chance for defects and such, I would buy the other guy's product.

      Your bar is too low. If you bought it as a charity case or because you want to help out local / new businesses I could understand, but putting up with defective products just because you are too lazy is idiotic. You have to be demanding or the manufacturers will keep putting out crap, and the crappier they are, the more it wastes your time and money in the long run. So if you are lazy, be lazy later rather than now.

  2. I'm not your average joe MS basher by bytesex · · Score: 2, Insightful

    But I've got to say: this is just typical.

    --
    Religion is what happens when nature strikes and groupthink goes wrong.
    1. Re:I'm not your average joe MS basher by mike260 · · Score: 3, Insightful

      I'm not your average joe MS basher

      True enough; nowadays, the average Slashdot-dwelling MS basher will try to make some kind of reasoned, evidence-backed argument instead of just huffing loudly and saying "this is typical".

  3. Testing!?! by FranTaylor · · Score: 3, Insightful

    You would think that a company the size of Microsoft would have the resources to have a few Zunes in QA with their clocks set ahead. But hey, there were no lessons to be learned from Y2K, right?

    1. Re:Testing!?! by Anonymous Coward · · Score: 3, Funny

      What's Y2K? Isn't it 1909 now....?

  4. Re:Can anyone explain this bug? by sakdoctor · · Score: 4, Funny

    if (year % 400 == 0) hard_crash()
      else if (year % 100 == 0) boot()
      else if (year % 4 == 0) hard_crash()
      else boot()

  5. The Source Code by linumax · · Score: 4, Informative

    Here is source of the trouble.

    1. Re:The Source Code by wvmarle · · Score: 3, Insightful

      Look through the function starting at line 249: this causes the infinite loop.

      Assuming proper code management and version control they will probably branch off a release sometime for release in 2007, and in the meantime continue writing the next version, which may have been mostly finished in 2007 already but maybe only pass quality control in 2008 for release then.

      And this piece of code had not been tested/reviewed properly apparently.

  6. Re:Can anyone explain this bug? by Anonymous Coward · · Score: 5, Informative

    Here's the actual buggy code.
    The error is infinite loop in ConvertDays(), starting at line 249. The first loop does not cope with "IsLeapYear() == true" when "days == 366"

  7. Cause of the Zune crash? Third party drivers by Anonymous Coward · · Score: 2, Informative

    A quote from the ZuneBoards forum:

    After doing some poking around in the source code for the Zune's clock driver (available free from the Freescale website), I found the root cause of the now-infamous Zune 30 leapyear issue that struck everyone on New Year's Eve.

    The Zune's real-time clock stores the time in terms of days and seconds since January 1st, 1980. When the Zune's clock is accessed, the driver turns the number of days into years/months/days and the number of seconds into hours/minutes/seconds. Likewise, when the clock is set, the driver does the opposite.

    The Zune frontend first accesses the clock toward the end of the boot sequence. Doing this triggers the code that reads the clock and converts it to a date and time. Below is the part of this code that determines the year component of the date:

    Code:

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

    Under normal circumstances, this works just fine. The function keeps subtracting either 365 or 366 until it gets down to less than a year's worth of days, which it then turns into the month and day of month. Thing is, in the case of the last day of a leap year, it keeps going until it hits 366. Thanks to the if (days > 366), it stops subtracting anything if the loop happens to be on a leap year. But 366 is too large to break out of the main loop, meaning that the Zune keeps looping forever and doesn't do anything else.

    The unfortunate part is that there isn't anything that can be done to fix this besides somehow changing what the clock is set to (which is exactly what the battery disconnection trick ends up doing). On the other hand, it shows that Microsoft is correct: tomorrow, everyone's Zunes will operate normally again. However, if Microsoft doesn't fix this part of the firmware, the whole thing will happen all over again in 4 more years.. Hopefully by then a fix will be in place.

    http://www.zuneboards.com/forums/zune-news/38143-cause-zune-30-leapyear-problem-isolated.html

  8. Re:Can anyone explain this bug? by Fusen · · Score: 4, Informative

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

    source code that caused the bug.

  9. Amazing.. by NfoCipher · · Score: 5, Funny

    The first step to fix any microsoft problem - reboot.

    --
    I'm sorry, I can't hear you over the sound of how awesome I am.
  10. Re:Can anyone explain this bug? by Anonymous Coward · · Score: 5, Informative

    In case you can't see how this fails: On December 31st in a leap year, days is counted down to 366 like it's supposed to, and then the IsLeapYear() test is true, but days>366 is not, so the loop body does nothing and the while becomes an infinite loop.

    This code can not possibly have been accepted in any kind of code review. Someone would have pointed out that there are O(1) formulas for calendar calculations.

  11. Instead of bothering with a fix by dmomo · · Score: 5, Funny

    Wouldn't it be faster for Microsoft to simply give each of the 8 users a call and walk them through the work-around? If their numbers change in the next four years, they can simply notify Zune support.

    1. Re:Instead of bothering with a fix by EvanED · · Score: 2

      [posting to undo moderation... I chose the wrong post]

  12. Re:Can anyone explain this bug? by lucifuge31337 · · Score: 2, Insightful

    ...and a perfect example of why testers should be working closely with programmers, writing sensible unit tests as the code progresses.

    --
    Do not fold, spindle or mutilate.
  13. Draining battery all the way by postmortem · · Score: 3, Insightful

    Can't be good.

    I've seen this in laptops leading to drastically decreased storage capacity.

  14. My Experience by syntap · · Score: 4, Funny

    I hadn't turned on the Zune before I read about the problem, so I just left it off and turned it on the morning of Jan 1 and everything worked fine, no need to drain battery or anything.

    The above is not an admission that I own a Zune, just what I theoretically would have done and the theoretical results, based on heavy pretend observations.

  15. Re:Can anyone explain this bug? by UnknowingFool · · Score: 4, Funny

    The error is infinite loop . . .

    Typical MS. They're copying Apple again but this time too literally. :P

    --
    Well, there's spam egg sausage and spam, that's not got much spam in it.
  16. Re:Can anyone explain this bug? by UnknowingFool · · Score: 3, Insightful

    Someone would have pointed out that there are O(1) formulas for calendar calculations.

    For that to happen, MS would have to follow standards. You know where this discussion will go.

    --
    Well, there's spam egg sausage and spam, that's not got much spam in it.
  17. Re:Zune 80 by gparent · · Score: 2, Informative

    You're assuming too much. (AKA you're wrong, they didn't run on similar hardware)

  18. Re:Can anyone explain this bug? by judododo · · Score: 2, Informative

    If my understanding is correct, ConvertDays looks like it never returns FALSE either. This might not lead to an other bug but it shows the quality of the code.

  19. Out of curiosity... by The+Man · · Score: 2, Interesting

    Why does a music player need to know the date or time at all?

    1. Re:Out of curiosity... by Anonymous Coward · · Score: 2, Informative

      Why does a music player need to know the date or time at all?

      For the DRM to work.

      Non-DRM using pirates win again, arrrr!

    2. Re:Out of curiosity... by AmberBlackCat · · Score: 2, Interesting

      For me, it helps for "smart playlists". I have iTunes set to automatically put recently added and recently played music on my iPod. The recently played list would get out of date if the iPod couldn't track when the music was played. And I agree with this guy. I use my iPod as a clock more often than I use my cellphone.

    3. Re:Out of curiosity... by base3 · · Score: 2, Informative

      So it knows when to expire the DRM-encumbered tracks that might have been loaded on it. Hell, I'm surprised it doesn't have GPS so it can enforce region restrictions on "content" too.

      --
      One CPU cycle wasted on digital restrictions management is ONE TOO MANY.
    4. Re:Out of curiosity... by cbhacking · · Score: 2, Informative

      Anything from month-to-month media rental (for example, the Zune Pass) to simply displaying the time like a watch (how many people do you know who pull out their cell phones to check the time? I know at least 4, and it amuses me to no end, but in any case a "current time" display was one of the most-requested features for the Zune 3.0 firmware).

      --
      There's no place I could be, since I've found Serenity...
  20. Re:Zune 80 by Lars+T. · · Score: 3, Informative
    http://forums.zune.net/412486/ShowPost.aspx

    Q: Why is this issue isolated to the Zune 30 device?
    It is a bug in a driver for a part that is only used in the Zune 30 device.

    --

    Lars T.

    To the guy who modded me down from perfect to terrible Karma - Apple haters still suck

  21. Re:Can anyone explain this bug? by JackHoffman · · Score: 4, Informative

    The function iteratively converts days into years. If there are more days left in the days variable than there are days in a year (365), then the days in that year are subtracted from the days variable and added as 1 year to the year variable.

    It starts with year=1980, because the RTC counts days since 1/1/1980 (inclusive). For normal years, it subtracts 365 days and adds a year. After the first iteration, year is 1981 and days is the number of days since 1/1/1981 (inclusive). If the loop is currently looking at a leap year, then 366 days are subtracted from the days variable and 1 year is added to the year variable. So far the code looks like this:

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

    The crazy thing is that someone must have looked at the edge case in that code: The last day of a leap year. On that day, the above code fails by incrementing year once too often, because at the beginning of the last iteration, the loop test indicates that there are more days in the days variable than there are in a year, but there are not, because a leap year has 366 days. That edge case is caught by the second if:

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

    The loop goes into the last iteration because of the loop condition which is on day short, then the IsLeapYear test selects the first branch, and instead of blindly incrementing the year and subtracting 366 days, there is an extra check if there are really more days left to make a full year...and then it fails to handle the only case where the code fails without that extra check. It should simply break the loop:

    while (days>365){
        if (IsLeapYear(year)){
            if (days>366){
                days-=366;
            }else{
                break; // days==366 && IsLeapYear(year): end of calculation
            }
        }else{
            days-=365;
        }
        year+=1;
    }

    (Matt's code always reduces the day count by 366. 1980 was a leap year.)

  22. All they've done by fm6 · · Score: 3, Interesting

    ... all Microsoft has done is to ask users to wait out the conditions that triggered the bug.

    And considering that the bug only came to light two days ago, that's pretty good.

    I speak from experience. I'm a tech writer, and I've written literally thousands of bug summaries for customer support web sites and release notes. (In 1999, I did almost nothing else.) Finding the problem, identifying a workaround, and getting it out to the public in such a short time is pretty impressive.

    Presumably they're working on a patch, but they won't say they anything about it until it's ready to go. It's an ironclad rule that you never talk about these things before they're ready, not if you want avoid vaporware lawsuits. It should be obvious to anybody that creating, testing, and staging a software patch takes a lot longer than writing up a workaround.