[cairo] [PATCH] scaled-font: Hold the scaled font mutex whilst reaping from the global cache

Chris Wilson chris at chris-wilson.co.uk
Tue Jan 8 07:09:47 PST 2013


On Tue, 08 Jan 2013 23:29:02 +1030, Adrian Johnson <ajohnson at redneon.com> wrote:
> I tested the patch with the test case in bug 54950 and got this:
> 
> cairo-scaled-font.c:464: _cairo_scaled_glyph_page_destroy: Assertion
> `!scaled_font->global_cache_frozen' failed.
> Aborted

Which turned out to be a different bug, where we leaked the frozen_count
on the global glyph cache, effectively allowing us to hold open all
glyphs for all fonts.

commit 44a093eb95c950b0e8f2d7d1cdb9719cb8a550f7
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Jan 8 14:58:41 2013 +0000

    scaled-font: Always hold the mutex even for single glyph probes

Then the deadlock was indeed a recursion through a recording_surface
beneath the glyph:

commit 4d4bf8fddff49d349e03282ffa827f6f4659e3fe
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Jan 8 14:56:07 2013 +0000

    scaled-font: Free the cached glyphs from the font before taking the
global lock

And I added more assertions to make sure we don't leak the global glyph
cache again. Thanks,
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the cairo mailing list