Bug 93891

Summary: Hang when recursing in _cairo_scaled_font_reset_cache()
Product: cairo Reporter: Hans Petter Jansson <hpj>
Component: generalAssignee: Chris Wilson <chris>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: medium CC: freedesktop
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: 0001-scaled-font-Fix-deadlock-when-recursing-in-_cairo_sc.patch
evince-11.3test.pdf
gdb.txt

Description Hans Petter Jansson 2016-01-27 19:03:52 UTC
The destruction of a scaled font can indirectly trigger the destruction
of a second scaled font, causing the global cache to be locked twice in
the same thread.

This can cause applications to deadlock when rendering certain PDF documents.
Comment 1 Hans Petter Jansson 2016-01-27 19:06:31 UTC
Created attachment 121328 [details] [review]
0001-scaled-font-Fix-deadlock-when-recursing-in-_cairo_sc.patch

Patch that fixes the bug here.
Comment 2 Behdad Esfahbod 2016-08-02 05:06:28 UTC
I don't pretend to know the glyph cache anymore, but I trust you with your analysis.

Humm, let's see any of the surviving maintainers can push this in.  Anyone?
Comment 3 Hans Petter Jansson 2016-08-02 20:59:51 UTC
Created attachment 125494 [details]
evince-11.3test.pdf

PDF that triggers the bug if viewed in evince (Cairo 1.12.16).
Comment 4 Hans Petter Jansson 2016-08-02 21:00:58 UTC
Created attachment 125495 [details]
gdb.txt

gdb trace. See thread 6.
Comment 5 Behdad Esfahbod 2016-08-02 21:22:13 UTC
Thanks.  Verified fixed and pushed to master.

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.