Slashdot Mirror


The Exact Cause of the Zune Meltdown

An anonymous reader writes "The Zune 30 failure became national news when it happened just three days ago. The source code for the bad driver leaked soon after, and now, someone has come up with a very detailed explanation for where the code was bad as well as a number of solutions to deal with it. From a coding/QA standpoint, one has to wonder how this bug was missed if the quality assurance team wasn't slacking off. Worse yet: this bug affects every Windows CE device carrying this driver."

2 of 465 comments (clear)

  1. Bigger bugs have gotten through on Windows CE by msgmonkey · · Score: 5, Interesting

    For example I had some code I developed on Windows CE 4.2 .NET which kept on hanging on calling the FindWindow() fuction call.

    Turns out that trying to find a window by class name will hang (this version of) CE every time, even though you would have thought its a very much used function call and would be caught by CE.

    So no I'm not surprised at all that this bug got through.

  2. Re:Regardless of whatever code in it is faulty by concernedadmin · · Score: 5, Interesting

    Lines 122, 521, 690, 710, and 748 scare me; gotos in C code...

    They've used one form of a goto that's actually quite readable and useful. Would you rather have:

    if (condition1 && condition2) {
    /* boilerplate code with a return */
    }

    if (issue1 || issue2) {
    /* same repeated boilerplate code with a return */
    }

    or

    if (condition1 && condition2) {
    goto cleanup;
    }

    if (issue1 || issue2) {
    goto cleanup;
    }
    cleanup:
    /* just one instance of this code,
    no need for duplication of efforts */
    Believe it or not, there are useful reasons to use goto, and Microsoft happened to use goto for the right reason here. The Linux kernel also happens to use this practice to boost the readability of the code.