[cairo] Xlib issue

Daniel Price daniel.price at monash.edu
Sun Sep 11 19:41:47 PDT 2011


Dear cairo developers,

 We've recently developed a 2D scientific plotting library called giza (because it's based on cairo!), meant as a low-dependency backend replacement for PGPLOT in Astronomy software (see http://giza.sourceforge.net/).

There is one nasty bug that I've been trying to chase in the Xlib driver that seems to be a cairo thing, but seemingly only in older versions of cairo. It occurs when I open a cairo-xlib surface for the second time (after having closed the first one) and consists of errors like:
===========================================
X Error of failed request:  150
 Major opcode of failed request:  144 (RENDER)
 Minor opcode of failed request:  23 (RenderCompositeGlyphs8)
 Serial number of failed request:  53
 Current serial number in output stream:  3998
===========================================

I have found references to similar things in earlier threads w.r.t multi-threaded applications. For example this thread:

http://lists.cairographics.org/archives/cairo/2009-December/018629.html

giza doesn't use multiple threads but maybe opening a second xlib device has a similar effect? It seems like something is not being closed off properly when closing the first xlib surface, but I can't find anything in my code that could cause that (I've boiled it down to a reasonably simple test case). I should point out that the context is completely destroyed and then recreated before opening the device for the second time.

My questions for the list are:
a) Is/was this was a known issue with cairo-xlib devices?
b) If so, what is the minimum version of cairo that it was fixed in?
c) Is there a workaround to prevent this bug with older versions of cairo? (ideally I would prefer to be able to use whatever cairo is installed by default on the user's system, rather than enforcing installation of a new version)

Any light that can be shed on this would be much appreciated.

Thanks,

Daniel



More information about the cairo mailing list