Slashdot Mirror


Whose Bug Is This Anyway?

An anonymous reader writes "Patrick Wyatt, one of the developers behind the original Warcraft and StarCraft games, as well as Diablo and Guild Wars, has a post about some of the bug hunting he's done throughout his career. He covers familiar topics — crunch time leading to stupid mistakes and finding bugs in compilers rather than game code — and shares a story about finding a way to diagnose hardware failure for players of Guild Wars. Quoting: '[Mike O'Brien] wrote a module ("OsStress") which would allocate a block of memory, perform calculations in that memory block, and then compare the results of the calculation to a table of known answers. He encoded this stress-test into the main game loop so that the computer would perform this verification step about 30-50 times per second. On a properly functioning computer this stress test should never fail, but surprisingly we discovered that on about 1% of the computers being used to play Guild Wars it did fail! One percent might not sound like a big deal, but when one million gamers play the game on any given day that means 10,000 would have at least one crash bug. Our programming team could spend weeks researching the bugs for just one day at that rate!'"

7 of 241 comments (clear)

  1. Re:I don't believe 1% of computers give wrong answ by PaladinAlpha · · Score: 5, Insightful

    You don't have any idea what you're talking about, and that's why you don't understand what he's talking about.

  2. How to deal with compiler bugs by MtHuurne · · Score: 5, Insightful

    If you suspect the compiler is generating invalid machine code, try to make a minimal test case for it. If you succeed, file a bug report and add that test case; the compiler developers will appreciate it. If you don't succeed in finding a minimal test case that triggers the same issue, it's likely not a compiler bug but an issue in your program in some place where you weren't expecting it.

  3. Re:I don't believe 1% of computers give wrong answ by Jeremi · · Score: 5, Insightful

    I think this is bull. I just don't believe 1% of computers give wrong answers

    1% of all computers? Probably not.

    1% of gamers' computers, in an era when PC gaming technology was progressing very quickly, and so gamers were often running overclocked (or otherwise poorly set up) hardware? Sounds plausible enough.

    --


    I don't care if it's 90,000 hectares. That lake was not my doing.
  4. Re:I don't believe 1% of computers give wrong answ by MtHuurne · · Score: 5, Insightful

    He said 1% of computers that were used to play Guild Wars gave wrong answers. Gaming PCs are more likely to be overclocked too far, have under-dimensioned power supplies or overheating issues than the average PC. 1% doesn't sound unrealistically high to me.

  5. Yep, seen it all by russotto · · Score: 5, Insightful

    I've had compilers miscompile my code, assemblers mis-assemble it, and even on a few cases CPUs mis-execute it consistently (look up CPU6 and msp430). Random crashes due to bad memory/cpu... yep. But on very rare occasions, I find that the bug is indeed in my own code, so I check there first.

  6. Re:OsStress by Anonymous Coward · · Score: 5, Insightful

    Bullshit. While Intel does occasionally bin processors into lower speeds to fulfill quotas and such, often times those processors are binned lower because they can't pass the QA process at their full speed. But they can pass the QA process when running at a lower speed. These processors were meant to be the same as the more expensive line, but due to minor defects can't run stably or reliably at the higher speed. Or at least not enough for Intel to sell them at full speed.

    Which is a large part of why some processors in the same batch can handle it when others can't.

    As much as I hate Intel, I think we could at least realize that they are often times doing this with good reason.

  7. Re:Wait its possible?! by disambiguated · · Score: 5, Insightful

    You're a better programmer for assuming it's not a compiler bug and trying harder to figure out what you did wrong.

    I've been programming professionally for over 20 years, mostly in C/C++ (MSVC, GCC, and recently CLang (and others back in the olden days)). I've seen maybe two serious compiler bugs in the past 10 years. They used to be common.

    On the other hand, I can't count how many times I've seen coders insist there must be a compiler bug when after investigation, the compiler had done exactly what it should according to the standard (or according to the compiler vendor's documentation when the compiler intentionally deviated from the standard).

    By "serious", I mean the compiler itself doesn't crash, issues no warnings or errors, but generates incorrect code. Maybe I've just been lucky. (Or maybe QA just never found them ;-)

    Oh, and btw, yes I realize you were joking (and I found it funny.)