Tales of the Rampant Coyote
Adventures in Indie Gaming!


(  RSS Feed! | Games! | Forums! )

Monday, July 10, 2006
 
The Joy of Debugging
I just read an incredibly amusing story about debugging (in this case, figuring out the problem in SendMail):

The Case of the 500-Mile Email

Wherein a young systems administrator in charge of email must figure out why the school email system is only sending email to a distance of 500 miles.

Way too much programming ends up being detective-work bug hunts like this, unfortunately, so it hits close to home. Though the more spectacularly bizarre ones do get a little more entertaining - the ones that you SWEAR are completely impossible.

One of the advantages to having been doing it for a while is that you learn to think like a computer. Or like another programmer. This might be why veteran programmers are so dang weird. But that sort of thinking allows you to take shortcuts and guess what might be going wrong, circumventing a lot of hunting and testing and stepping through code line-by-line waiting for something that's supposed to happen to not happen at all (one of the more painful bugs to track down).

Did you enjoy this post? Feel free to share it: del.icio.us | Digg it | Furl | reddit | Yahoo MyWeb

Comments:
At my day job, I run into debugging issues which almost always get solved when I slow down and basically run an assert on my thinking. If the constructor is asserting that the file does not exist, and I can see the file plainly in the directory that I know it is looking in, then I need to verify the obvious: is it looking for the same file that I think it is looking for? It would save me a lot of stress and time if I would just ask these kinds of questions.

As for my example, the filename in the configuration had the word "point" in it, but the file's actual name had "pnt" instead.

My favorite headache, however, was a configuration file that worked just fine and then all of a sudden stopped. Weird things, like expecting capital letters when lower case was working fine all this time. It turned out that the configuration file was never getting loaded until I had changed some code which required loading it. The file was always wrong, but I didn't know it until then.
 
Heh! Those are good ones!

I've been bitten by something very similar before --- I had some temporary code that I thought I'd gotten rid of, and the real code that I thought was active, and then couldn't figure out the bug in the "real" code until I stepped through it and discovered that it was NEVER being called. OOPS!

My favorite (and most painful) bug --- well, I'll have to make a full post on that one some day. It's game-related.
 
Try being a QA Engineer and trying to think like the programmer while keeping in mind the requirements of the Business Analyst...talk about ways to make your brain explode. How to explain to the programmer that when the weather is just so and you tilt your head to the right their program explodes...
 
There's always the time we got an instant boost in framerate when Danny discovered that the animated characters in the scene were being drawn twice. :)

My current problem is that an application is pausing for between 5 and 100 seconds at random but infrequent intervals, like maybe 5 times overnight. We're playing detective on it now. It has symptoms like system interrupts dropping by 30% during the pauses, and the pauses are not always at the same point in the code. We're triggering the whole system to go nappy-time somehow. Want to trade bugs?
 
Post a Comment

Links to this post:

Create a Link



<< Home

Powered by Blogger