21 March 2003


Had a nice dinner with the other LCA2003 organisers. The proceedings CD took a bit longer to finalise than expected, but it is pretty much done now.


Some very weird stuff is happening in the XFree86 project at the moment. The characterisation of Keith Packard by some of the XFree board just doesn’t mesh with my experience dealing with him. His approach of working with the people who will be using the code has worked really well (it is no accident that Xft and fontconfig have become so popular and widely deployed so quickly). His post to the forum list seems very sound from my point of view.


Started doing a bit of work on toolbar customisation for EggToolbar. I have basic DnD drop highlighting working in the toolbar. I think it might be necessary to add an optional input only window to EggToolItem to make dragging them easier in toolbar customisation mode. It looks like it should all work fairly well.

Of course, these bits are relatively easy, so we will see how things go …

GTA: Vice City

Ran into a weird bug while playing it a few days ago. At the end of one of the missions, there was a short cut scene where one of the characters (Phil) was meant to limp from the car to the doctors. During the mission, the cops had started chasing me. Since the cut scenes are run through the game engine itself (and in the game world), the cops were still racing down the street. The next thing I knew Phil got mowed down while walking to the doctor and the cut scene effectively hung. Gives an interesting insight into how bits of the game were implemented.

16 March 2003


I recently upgraded the Mailman installation on the machine handling the pygtk mailing lists. I am now using Mailman 2.1.1, and so far it looks a lot nicer.

I took the opportunity to update my SpamAssassin patches for the new Mailman (the old filter didn’t work anymore). I now have the code for talking to spamd split into a separate module, which might be useful for other projects, and means that it can be updated for newer SpamAssassin versions as needed without changing the MM related code.

I now have the filter using the list name as the user passed to spamd. Together with the virtual user dir mode in spamd, I now have SA maintaining separate auto-whitelists and bayes databases for each list, which should help improve the filtering.

What would be nice to do next would be to get the Mailman moderation page hooked up to SA, so that it can feed the decisions made during moderation back to the bayes database. Will need to think a bit about how best to implement this though.

Peace March

The next peace march in Perth is being held on Saturday (March 22nd) at noon. Will be interesting to see if more or less people will come to this one compared to the previous march.

6 March 2003

Build Infrastructure

Got approval and checked in my glib changes. I also have intltool modified po/Makefile.in.in‘s passing make distcheck with newer automakes, which should make upgrading other modules a lot easier.

Talked to malcolm who has apparently been working on some docs for updating packages to newer versions of the build tools, so I won’t be writing my own document.

PyGTK, Reference Counting and Cyclic GC

When I started working on the 1.99.x branch of PyGTK, I added a feature to make sure that there was at most one Python wrapper object for each GObject, and that the wrapper would stay alive for as long as the GObject did and vice vesa.

This is implemented using a bit of a hack, which I needed to update as Python 2.2 developped. It essentially goes like this:

  • The Python wrapper holds a reference to the GObject
  • The GObject holds a pointer to the wrapper, but doesn’t own a reference.
  • If the refcount on the wrapper goes down to zero and it gets freed, and the GObject’s ref count was greater than 1 (ie. something other than the wrapper holds a ref to the GObject), the tp_dealloc() routine would resurrect the wrapper. The GObject would now own a reference to the Python object.
  • If some other code tried to get the wrapper for the GObject, the saved reference would be transferred to it (ie. the GObject would no longer own the last reference).
  • If the GObject later gets disposed, the wrapper will be freed.

This worked okay for a while, until I started work on adding cycle GC support for wrappers. Since the GObject didn’t hold a real reference to the wrapper, if the only references on the wrapper were parts of cycles, the GC might think it okay to free the wrapper. Due to a small bug in pygtk, the wrapper itself wasn’t being cleared, but its instance dictionary was. This led to the unfortunate situation where all the instance attributes would sometimes disapear.

The obvious solution (in retrospect) is to work with the cycle GC when implementing the single-wrapper-per-GObject code, rather than ignoring it. Instead of the current hacks, I make the GObject hold a reference to the wrapper and the wrapper hold a refernce to the GObject, forming a cycle.

Since the Python cycle GC only applies to PyObjects, I still needed some way to communicate information about references on the GObject to the GC code. If there are references to the GObject other than the one its wrapper holds, then we obviously don’t want to free either.

I came up with a smart solution that seems to handle this very nicely: If the GObject reference count is equal to 1, then the wrapper will visit itself as part of the GC traverse, otherwise it won’t visit itself. Essentially this means:

  • If anything other than the wrapper holds a reference to the GObject, make the reference the GObject holds on the wrapper look like an external reference.
  • If the only reference on the GObject is held by its wrapper, make the reference the GObject holds on the wrapper look like a cycle.

This seems to solve the problem very nicely.


I just found out about the imapflags sieve extension implemented in the Cyrus IMAP server. This allows me to set IMAP flags on messages as part of the server side mail filtering.

Since the mozilla message labels are implemented as IMAP flags $Label1 to $Label5, I am able to set message labels as part of the delivery. This is quite useful for highlighting certain messages in a folder without sorting them into a separate folder. For example, I can highlight bugmail about new bugs in my bugzilla folder. Looks like it will be very useful.

Build Infrastructure

For the past few weeks, I have been working on improving the Gnome build infrastructure. It is something that we have needed to do for a long time. Most of Gnome is still using automake-1.4 because they rely on bugs that have since been fixed, and don’t handle the readonly sourcdir builds that “make distcheck” does with newer automakes.

So far I have been working on updating the various build tools that Gnome uses to reduce the amount of work needed to update a package’s build infrastructure. So far, I have updated the gnome-common package, removing most of the macros it contained and doing significant updates to the shared autogen.sh script, and gtk-doc (adding code to separate out the common section of the docs makefiles everyone is using).

To test things out, I recently ported glib over to using Automake 1.7. The patch is currently in its second revision, and waiting for another review. Afterwards, I might look at doing a bit of documentation on how to update a package — I don’t intend to do the conversion for every package in CVS …