talking in #cairo on IRC, sanooj came up with this patch: http://people.freedesktop.org/~joonas/tmp/image-ref.patch which fixed the problem
This is a patch against cairo, although atomic ref counting would be useful in pixman too.
Søren, the patch is irrelevant. It just highlights how Cairo needs atomic refcounting on pixman_image_t, without which the alternative is such a monstrosity. The solution lies within pixman.
whatever
Here's a patch that removes the need for atomic pixman_image_ref()/unref() in cairo, mostly by dropping the global solid colour cache: http://cgit.freedesktop.org/~joonas/cairo/commit/?h=no-pixman-ref&id=af403a204a88d882317a3e91abe8f0cc454852a4
I really think the bug should be flagged as still open. Adding atomic refcounting would be fairly easy using GCC builtins. See http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html
Fixed in cairo master. commit 71e8a4c23019b01aa43b334fcb2784c70daae9b5 Author: M Joonas Pihlaja <jpihlaja@cc.helsinki.fi> Date: Sat Feb 19 17:46:45 2011 +0200 image: Avoid reusing pixman images for threadsafety.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.