Thursday, June 17, 2004

Mozilla and Blogger
OK, this is weird. I've been taking it for granted that editing a blog with Mozilla meant that I had no way to "Preview" the page, nor could I use any of the buttons used for formatting. But I'm using my work machine, with the same build of Mozilla, and I get all those options. (Spelling does not work though. Does anyone know if this can be made to work on Mozilla?)

The only difference I can think of is the fact that my home machine can't run mozilla-xremote-client. I have no idea why. It used to work, and then I tried to install Java support, and then it didn't work anymore, even when I removed the Java link. This problem might be related to having trouble creating windows, and that might then explain the missing buttons on Blogger pages.

Interestingly, if I connect into my machine via ssh with X forwarding enabled, then I can run mozilla-xremote-client and it will work. The difference may be due to windows and widgets that are opened by mozilla-xremote-client all coming from remote machine. But I have no idea what is really happening.

Maybe I should take DM's advice and reinstall Linux. I've been running the same drive image since late 1999, so it's getting on a bit. As I've upgraded the hardware in the computer I've kept the drive, and just reconfigured the device drivers. Whenever I've upgraded the hard drive I just do a "tar -a" (with appropriate options for links, etc) from one drive to the next, and then run LILO to boot to the new drive. Every time I do this I find myself impressed once more with Linux. :-)

5 years is probably long enough though. I'll think about it...

Unclosed Tuples
I finally got them all! Then I ran the full gamut of tests and everything was successful. I was feeling pretty good. So I did a CVS update, and discovered that there have been quite a few changes lately, so I re-ran the tests. Sure enough, there were new Unclosed Tuples to fix. Everyone agrees that this needs to be fixed properly, but I'm still stuck on fixing them one at a time, so I went back in to work on it.

The problem was with a close() in the Query class. DM commented it out to get certain types of queries to work. The Answer object being closed was sometimes closed in other places, and sometimes not. Since closing killed the running query, and not closing only caused an error in the log, the option of commenting out the close statement made sense.

The Answer passed as the GIVEN clause for a Query is always owned by the resulting Query object. This answer is then closed by closing the query. At this point I discovered that most parts of the code do not close Query objects. That is a mistake, so I added the query closure statements, and promptly got a NullPointerException.

Looking at the Query.close() method revealed that it iterates over its variable list. Only it is possible to create a Query object with a null variable list, which would guarantee the close method would fail. In other words, whoever wrote the close method only intended to call it under certain circumstances (ie. when the variable list is not null). I don't know exactly what those circumstances are, as there may be other preconditions, and there is no documentation to describe it. So I made the close method safe by doing a test for null on the variable list, and then I made sure that Query objects always get closed. Naturally, this wasn't immediately successful, but I've found all the offending code.

I now have it working again, and fully checked in. I'll give it until next week before someone else introduces a new "Unclosed Tuples" error message.

This really needs to be fixed correctly. Maybe if someone else fixes it next time they will complain enough that TJ will decide to tell someone to do it. :-)

No comments: