Bug 81874 - Huge multi-threading violations in cairo
Summary: Huge multi-threading violations in cairo
Status: RESOLVED DUPLICATE of bug 69034
Alias: None
Product: cairo
Classification: Unclassified
Component: freetype font backend (show other bugs)
Version: unspecified
Hardware: All All
: highest critical
Assignee: David Turner
QA Contact: cairo-bugs mailing list
URL: https://bugs.launchpad.net/ubuntu/+so...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-29 12:20 UTC by Alberto Salvia Novella
Modified: 2014-07-31 16:45 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Alberto Salvia Novella 2014-07-29 12:20:17 UTC
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)
Comment 1 Behdad Esfahbod 2014-07-31 14:53:24 UTC
That's accurate.  We have another bug for this already.  Unfortunately not one has time to go through the convoluted code there and fix it.  I think TLS is the easiest way to fix this.  Perhaps we can copy the TLS infrastructure from Pixman.
Comment 2 Alberto Salvia Novella 2014-07-31 15:42:55 UTC
There isn't time for everything, although always enough for the important things.

So you believe there's something more important for your product where to put everybody to work on right now than a critical flaw in it, is it that?
Comment 3 Behdad Esfahbod 2014-07-31 16:12:14 UTC
That attitude won't get you far.  At least have the courtesy to respect people's choice of what to work on when you use Free Software.
Comment 4 Alberto Salvia Novella 2014-07-31 16:41:33 UTC
Sorry, you are right.

Most of the time people get angry for their own personal reasons, and really nothing about you: and in my case is because I am writing my date right now to stop it.

So excuse my claws, and thanks for the good work. Argss!!
Comment 5 Behdad Esfahbod 2014-07-31 16:45:44 UTC

*** This bug has been marked as a duplicate of bug 69034 ***


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.