[cairo] Can an expert look at this stack trace?

Julien Bramary julien_bramary at msn.com
Fri Dec 4 21:06:51 PST 2009

Hello all, this is my first post to this list.

I am writing a threaded cairo application and I need help understanding a rare-ish bug.
I'm still using cairo 1.8.8 but considering an upgrade to get the nice profiling tools.

Every so often I get the following crash:
cairo-board: cairo-surface.c:406: cairo_surface_reference: Assertion `((*&(&surface->ref_count)->ref_count) > 0)' failed.
Obtained 45 stack frames.
/lib/libc.so.6 [0x7f2e23ae1290]
/lib/libc.so.6(gsignal+0x35) [0x7f2e23ae1205]
/lib/libc.so.6(abort+0x183) [0x7f2e23ae2723]
/lib/libc.so.6(__assert_fail+0xe9) [0x7f2e23ada229]
/usr/lib/libcairo.so.2 [0x7f2e2496cbb0]
/usr/lib/libcairo.so.2 [0x7f2e249654dd]
/usr/lib/libcairo.so.2(cairo_pattern_create_for_surface+0x7d) [0x7f2e24966a6d]
/usr/lib/libcairo.so.2(cairo_set_source_surface+0x46) [0x7f2e249525b6]
./cairo-board [0x40f591]

If understand correctly my application is calling set_source_surface on an invalid surface?
Does it mean the surface was destroyed? This is very possible as the code is quite convoluted.

The rarity of the crash (less than 1/100) makes me think it might be a timing issue with a thread destroying the surface while another one tries to read it with cairo_set_source_surface but I can't see where as everything should be locked...
I'd like to know if an expert can confirm.

Thanks very much
Keep your friends updated—even when you’re not signed in.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20091205/92ac7eed/attachment.html 

More information about the cairo mailing list