Friday, May 28, 2010

Three hours of debugging...

...for nothing.

My professor sent me an email this evening saying he had managed to get the application I'm writing for him running without much trouble but many of the important effects were missing. He only uses Ubuntu and I've been working in Windows, so I wasn't terribly surprised and resigned myself to installing Ubuntu somewhere and testing out the app in that environment.



I've had some trouble getting Ubuntu installed on this computer in the past, so I decided to try the Wubi Installer to install Ubuntu this time. Immediately after downloading it and trying to run the executable I'm presented with errors that seem to indicate that my hard drive is missing... and dismissing the dialog just causes another one to pop up. Eventually, after several attempts and a little web crawling, I discovered that the repeating dialogs would come to an end if I dismissed them enough. Then the installer seemed to do the right thing. It went on it's merry little way until it came time to restart the computer.

I restarted the computer... and it didn't come back up.

Not only did it not boot into Ubuntu like it was supposed to, it didn't even give me a chance to boot into Windows. Sigh.

My first thought at this point was to be sure I could save my Windows installation, so I grabbed my Windows 7 boot disk and rebooted into the recovery tools on it. Since my computer was out to lunch, I did a little googling on my phone to figure out how to restore the boot loader and restored the default Windows bootloader.

I figured at this point my erstwhile Ubuntu install was lost, since I wasn't using the Grub bootloader anymore, but to my surprise, when I rebooted again I was given options for both Windows and Ubuntu. After a quick boot into Windows to make sure everything was working well, I rebooted again, and this time selected Ubuntu.
Theme

Ubuntu finished up it's install and dropped me on a nice, clean, purple desktop. A somewhat irritating graphical glitch in the upper left portion of the screen, but it was liveable.

A few minutes later, I had installed the necessary tools in the environment and was ready to dig into the problem. I got all the dependencies installed and launched my application. Sure enough, the problem Ben was having showed up right away. At least it was being cooperative with me.

My first thought was that something I was drawing wasn't being drawn in the proper place -- it wouldn't be surprising since I hadn't done anything special to control it. So I started down that line of investigation only to discover that my objects weren't even attempting to be drawn. That's strange...

Oh... the SVG file I'm looking into doesn't seem to have my expected elements in it... am I generating it correctly?

Yes...

Oh, but Graphviz isn't writing the file correctly... strange, since it worked just fine in Windows. A few quick tests and I proved to myself that Graphviz had a giant bug that was preventing my code from naming elements properly. Ugh.

I started searching around the internet but couldn't find any reference to the bug. Out of options, I decided to uninstall Ubuntu's version of the package and install it from source instead. Ten minutes later I had the package re-installed from source and ran my application again -- and it worked perfectly!

So, the current version of Graphviz distributed with Ubuntu's has a bug introduced that prevents the "id" attribute from properly naming nodes, at least with the SVG output format. I'm not sure why no one else had run into that problem but it's fairly significant for anyone that's using that attribute, since they're probably using it for a reason.

All that to say, I just spent 3 hours from starting to investigate the problem by installing Ubuntu until tracking down the problem, only to find that it wasn't a problem with my application at all.

C'est la vie.

1 comment: