[cairo] Multithreaded cairo-test

Chris Wilson chris at chris-wilson.co.uk
Fri Mar 23 19:05:49 PDT 2007


Behdad Esfahbod (behdad at behdad.org) said: 
> Woot.  Is this yet another valgrind skin you've wrote?
It's a little incomplete - as in I developed it far enough to debug that
deadlock and then went back to beating upon Cairo ;-)

Have a browse:
http://gitweb.freedesktop.org/?p=users/ickle/valgrind;a=shortlog;h=lockdep

It's the simplest skin to run as it doesn't take any cmdline options at
all:
$ valgrind --tool=lockdep ./cairo-perf -t 10

The future plans are for it to check the pre/post conditions for
pthread_mutex_lock() ala Ingo Molnar's kernel lockdep - but with the
restriction that no source annotations are possible. And to complete
the checking for all the simple error cases. Though I imagine
development will continue to be driven by the need to track down bugs :-|

Eeek - distraction...  glyph-cache-pressure:
==15465== Thread 3:
==15465== Invalid read of size 4
==15465==    at 0x41DE49D: process_responses (xcb_io.c:133)
==15465==    by 0x41DE9BB: _XReply (xcb_io.c:371)
==15465==    by 0x41BC7DB: XGetImage (GetImage.c:75)
==15465==    by 0x4066A6E: _get_image_surface (cairo-xlib-surface.c:564)
==15465==    by 0x4066DD9: _cairo_xlib_surface_acquire_source_image (cairo-xlib-surface.c:804)
==15465==    by 0x4040AE1: _cairo_surface_acquire_source_image (cairo-surface.c:870)
==15465==    by 0x40588EB: write_png (cairo-png.c:102)
==15465==    by 0x4058C64: cairo_surface_write_to_png (cairo-png.c:244)
==15465==    by 0x804B79A: cairo_test_targets (cairo-test.c:314)
==15465==    by 0x428AE59: start_thread (pthread_create.c:296)
==15465==    by 0x438189D: clone (in /usr/lib/debug/libc-2.5.so)
==15465==  Address 0x445D4E0 is 56 bytes inside a block of size 60 free'd
==15465==    at 0x402123A: free (vg_replace_malloc.c:233)
==15465==    by 0x41DE667: process_responses (xcb_io.c:156)
==15465==    by 0x41DE9BB: _XReply (xcb_io.c:371)
==15465==    by 0x41BC7DB: XGetImage (GetImage.c:75)
==15465==    by 0x4066A6E: _get_image_surface (cairo-xlib-surface.c:564)
==15465==    by 0x4066DD9: _cairo_xlib_surface_acquire_source_image (cairo-xlib-surface.c:804)
==15465==    by 0x4040AE1: _cairo_surface_acquire_source_image (cairo-surface.c:870)
==15465==    by 0x40588EB: write_png (cairo-png.c:102)
==15465==    by 0x4058C64: cairo_surface_write_to_png (cairo-png.c:244)
==15465==    by 0x804B79A: cairo_test_targets (cairo-test.c:314)
==15465==    by 0x428AE59: start_thread (pthread_create.c:296)
==15465==    by 0x438189D: clone (in /usr/lib/debug/libc-2.5.so)
==15465== 
==15465== Thread 4:
==15465== Invalid read of size 4
==15465==    at 0x41DE9AA: _XReply (xcb_io.c:371)
==15465==    by 0x41D2B69: XSync (Sync.c:48)
==15465==    by 0x41D2CE4: _XSyncFunction (Synchro.c:37)
==15465==    by 0x4195879: XRenderFreeGlyphs (Glyph.c:136)
==15465==    by 0x40655FD: _cairo_xlib_surface_scaled_glyph_fini (cairo-xlib-surface.c:2345)
==15465==    by 0x403CD96: _cairo_scaled_glyph_destroy (cairo-scaled-font.c:59)
==15465==    by 0x403133F: _cairo_cache_remove (cairo-cache.c:350)
==15465==    by 0x4031378: _cairo_cache_shrink_to_accommodate (cairo-cache.c:264)
==15465==    by 0x403EA27: _cairo_scaled_font_text_to_glyphs (cairo-scaled-font.c:946)
==15465==    by 0x40340A2: _cairo_gstate_text_to_glyphs (cairo-gstate.c:1514)
==15465==    by 0x402DAA5: cairo_show_text (cairo.c:2816)
==15465==    by 0x804A213: draw (glyph-cache-pressure.c:80)
==15465==  Address 0x445D4E0 is 56 bytes inside a block of size 60 free'd
==15465==    at 0x402123A: free (vg_replace_malloc.c:233)
==15465==    by 0x41DE667: process_responses (xcb_io.c:156)
==15465==    by 0x41DE9BB: _XReply (xcb_io.c:371)
==15465==    by 0x41BC7DB: XGetImage (GetImage.c:75)
==15465==    by 0x4066A6E: _get_image_surface (cairo-xlib-surface.c:564)
==15465==    by 0x4066DD9: _cairo_xlib_surface_acquire_source_image (cairo-xlib-surface.c:804)
==15465==    by 0x4040AE1: _cairo_surface_acquire_source_image (cairo-surface.c:870)
==15465==    by 0x40588EB: write_png (cairo-png.c:102)
==15465==    by 0x4058C64: cairo_surface_write_to_png (cairo-png.c:244)
==15465==    by 0x804B79A: cairo_test_targets (cairo-test.c:314)
==15465==    by 0x428AE59: start_thread (pthread_create.c:296)
==15465==    by 0x438189D: clone (in /usr/lib/debug/libc-2.5.so)
==15465== 

Now, that does look nasty.
--
Chris Wilson


More information about the cairo mailing list