Today’s interesting discovery

If you want to cut the first 9854797 lines of one file, and put them at the beginning of a 3023304 line file, opening them both up in vim and cutting and pasting from one to the other is probably not the most efficient way to do it. It’s been pasting for a while, and my load average is up over 8 and I’m using 1.4Gb of swap.

Maybe I should kill this and figure out how to do it with awk or something.

Xen troubles

Yesterday I went out to the colo to put another hard drive in my 1U box. I’ve shut down my box about 3 times now, and one of the times the third domU got a corrupt disk and had to be wiped and reinstalled. That’s why I tried so hard to make sure that all the disks got mounted as ext3 (with journalling) instead of ext2 (no journalling). This time, just to make sure, I used the “xm shutdown [domU name]” on all three domUs before I shut down the box, just to make sure they shut down cleanly.

It took a bit of struggling to get the second drive working – I had to jumper the drives as master and slave instead of cable select, and the 80 pin cable I brought along didn’t quite stretch from one to the other so I had to stick with the existing 40 pin cable. But other than that, it seemed like everything went fine.

Until I got an email from the owner of the third domU. He couldn’t log in. So I tried the “xm console”, and saw

xm console xen3
attempt to access beyond end of device
hda1: rw=0, want=1357711368, limit=104857600
attempt to access beyond end of device
hda1: rw=0, want=18058643056, limit=104857600
attempt to access beyond end of device
hda1: rw=0, want=2123850752, limit=104857600
attempt to access beyond end of device

and then it would prompt for a userid but never prompt for a password.

I shut down his domU and did an fsck on his lv, and it reported dozens if not hundreds of errors. It boots now, but I’m scared that it’s going to do this again.

Gah! I used to do this for a living?

As part of my vacation recovery, I decided to submit a patch to make GPSBabel understand CoPilot version 4 files. I wrote the module for understanding CoPilot files back in 2002, but it only understood version 3. I decided to make it check the version number in the header and do the right thing for any version.

Now back in 2002, I cargo culted the existing GPSPilot code, and what I was doing wasn’t hugely different from what I already had there. But I haven’t written C code for a living since … (checking my resume) … 1994. Since that time, I’ve been coding in C++, Java, and perl. And I haven’t even done C++ since 2002. Grovelling along a “pointer to data” to try and extract some binary data into a format I can use is something that these days I’d do using pack/unpack in perl. C just seems so damn primitive now – almost like something that belongs in the last millenium. And it does. I was so impressed with it when I first started using it. But that was a lifetime ago.

QA versus development

On a mailing list somewhere I was musing about why I, as a developer, always find myself annoyed at QA. And that’s not good, because QA and development are partners in making sure that what we develop comes to the customer as good as we can make it. But the problem is that development never has time to properly document what we’re doing to QA, and QA only communicates to development in the form of bug reports.

As far as I can tell, there are only N types of bug reports:

  1. annoying because you already knew about what they are reporting.
  2. annoying because you thought you were done that bit and now you have to go back to it.
  3. annoying because you know that part works and now you’ll have to drop everything to go show them how they are using it wrong.
  4. annoying because you thought that part works and now you’ll have to drop everything to have them show you how they are using it right.
  5. annoying because their bug report doesn’t give you enough detail.
  6. annoying because it goes into excruciating detail when you could tell what is wrong from the first sentence.
  7. annoying because it goes into excruciating detail about stuff you already knew, but glosses over the bit that tells you if it’s a known bug or something new.
  8. annoying because they are describing something that’s working the way it’s documented to work.
  9. annoying because they are describing something that’s working the way you want it to work, but you haven’t had time to document that behaviour yet.
  10. annoying because it’s the same bug they already logged a week ago.
  11. annoying because it’s so poorly written that you can’t tell if it’s the same problem as the one they already logged a week ago.
  12. annoying because you thought you’d fixed that last week but it’s obvious from the report that you missed something.
  13. annoying because you thought you’d fixed that last week and it’s not obvious from the report if they’re testing the new code or not.

But what it all comes down to is that QA is annoying because they’re a constant reminder that you’re not as good as you wish you were. I don’t want to be “only human”, I want to be perfect.