[cairo-bugs] [Bug 81874] New: Huge multi-threading violations in cairo

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Jul 29 05:20:17 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=81874

          Priority: medium
            Bug ID: 81874
          Assignee: david at freetype.org
           Summary: Huge multi-threading violations in cairo
        QA Contact: cairo-bugs at cairographics.org
          Severity: critical
    Classification: Unclassified
                OS: All
          Reporter: es20490446e at gmail.com
          Hardware: All
            Status: NEW
           Version: unspecified
         Component: freetype font backend
           Product: cairo

I looked at the implementation of cairo-ft-font.c and it seems that there are
huge multi-threading violations in cairo. The reason is that FreeType API
documentation clearly states:

In multi-threaded applications, make sure that the same FT_Library object or
any of its children doesn't get accessed in parallel.

Cairo initializes FT_Library for its font map and there's a lock for that,
however it's only used for font map manipulations, the actual FT_ library calls
are completely unprotected with that lock, although they should be! What adds
to the injury is that cairo-ft-font.c even has this comment on one of its
functions:

You must be careful when using this function in a library or in a
threaded application, because freetype's design makes it unsafe to
call freetype functions simultaneously from multiple threads, (even
if using distinct FT_Face objects)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo-bugs/attachments/20140729/9ae72a05/attachment.html>


More information about the cairo-bugs mailing list