16 March 2003

SpamAssassin/Mailman

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.

Sieve

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 …

25 February 2003

website

After not having touched my website for a long time (years), I finally decided to do a bit of work on it. Wrote some scripts to automatically generate the navigation links (and added <link> elements). Decided to put the slides for talks I have given up in one place. Still a fair bit more information worth putting up for the packages I maintain though.

linux.conf.au:2003

The conference CD should be finalised tomorrow (thanks to a lot of work done by Tony). We’ve got material from just about all the speakers, audio of all the talks (in Speex format) and some photos, so it should be quite good. The CD will be mailed out to delegates, and ISOs will be made available when they are ready.

Ring John Howard at Home

The Chaser stirred up a bit of trouble at the end of last week with the headline on the front page of their satirical newspaper: Howard Ignores the People. So call him at home on (02) 9922 6189. According to a story in the Sydney Morning Herald, his home phone was ringing non stop until they changed the number.

fontilus

Put out a new release of fontilus, which increased the number of supported languages from 2 (including the default english) to 21. It also has a few small UI improvements for the font view dialog, and adds a context menu item for fonts in the “fonts:” folder that allows you to easily set the default application font for Gnome.

You can also now use fontilus to view the Bitstream Vera fonts. The fonts are currently available in a limited beta form (you can download and use the fonts, but not redistribute them). The terms that will be used for the finished version of the fonts is also available at the above site, which probably meets the open source definition (some people think it doesn’t, but the license seems to satisfy all the points in the definition).