Tuesday, November 16, 2004
crushed a bug

Crushed a bug at work today.

This one was satisfying -- I'd been chasing it for days, and realized today that it wasn't anywhere neear where I was looking.

Yeah, that seems like an obvious observation -- of course it wasn't where I was initially looking. If it had been, I'd've finished the job a lot earlier.

But I found it. I stumbled upon a part of the system that suddenly exhibitted the behavior I had been looking for...

I'd spent days setting up tripwires everywhere in the code, waiting for the debugger to hit a breakpoint that meant that the seemingly impossible condition I had been looking for had been tracked down.

But no matter what I did, no mater how I prodded the code, none of the breakpoints would fire. The code kept chugging along.

This is a web-based system, with a batch component that runs nightly to produce reporting tables. The error I was trying to find was a reporting error, and it seemed obvious that the batch job was messing things up somehow. After all, it's always been the culprit in the past.

So I go to the interface to edit something to try out a new theory. I hit the submit button, and wait for the reponse.

And wait.

Still waiting.

Wait.

That's a debugger window. I'd finally hit one of the breakpoints.

So yeah, it was a classic. Someone changed some of the UI functionality, and the previously functioning code was now spraying garbage into the reporting tables.

It took me too damn long to find that bug. I was beginning to feel like an idiot.

Sure feels good to have found it.



11:08:56 PM    comments ()  trackback []  
returning to C

Hacking Frontier has meant returning to C after an extended absence. Yeah, I've done some recent C work, but nothing really intense, and certainly nothing that did a lot of pointer passing and tracking memory allocations.

I never forgot how to do it, but I've enjoyed not having to track all of that stuff just to express myself in a programming language.

Tracking memory errors is always interesting. The errors show up in places that seem to have nothing at all to do with the actual problem. If you are lucky, it crashes in the same place every time. If you are unlucky, sometimes it'll just randomly stop crashing.

I'm sure there are a lot of programmers out there, reading this, nodding silently in agreement. Memory allocation errors are not _the_ most difficult things to deal with, but they are certainly are among the most annoying.

The other side of the coin is that I'd forgotten about the speed gain.

Well, maybe I didn't forget it completely. During my most recent automata craze, I ended up coding some critical core routines in C and calling them from Python. But some of the stuff I've been doing while writing kernel code for Frontier has demonstrated the raw power... It's liek the first time I wrote assembly code on my Apple II. The speed was almost unimaginable.

It's certainly a lot of fun.



11:00:28 PM    comments ()  trackback []  
it's been a while.

Yeah, it's been a while since I posted. Or at least that's what I've been hearing from my large audience.

Yeah, Mom, that's you.

Besides, since my choice kind of, umm, well, LOST the election, I thought maybe it was time to move that post from the top. Besides, that hasn't been my main focus lately.

As you can imagine, I've been having ffun digging into the source code of Frontier, learning how to write kernel code, understanding how the Object Database inside of Frontier works, you know, that sort of geeky stufff.

Any journey that includes the Frontier source code begins here. You can download the source and a prebuilt version from this page, and for the more adventurous of you, there is a Sourceforge project for the source code here.

I feel like I've been handed a cool set of Tinker Toys. The more I learn about the innards of Frontier, the more I feel like I could bend it to my will.

Well, maybe not that extreme. Perhaps I could do some origami in the corner.

If you are interested in hacking the Frontier kernel too, get yourself over to the FrontierKernel group and join the list. They've answered every question I've asked, and the current thread on tuning the data structure that support Frontier tables has been fascinating. At least to me.

So there you go Mom, this is what has been taking up most of my brain time.



10:52:41 PM    comments ()  trackback []