[libGD] #69 [Task opened] Race condition / thread safety within gdImageStringFTEx

[email protected] (libGD)
Newsgroups php.gd.bugs
Message-ID <[email protected]>
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

A new Flyspray task has been opened.  Details are below.

User who did this - Scott MacVicar (ScottMac)

Attached to Project - libGD
Summary - Race condition / thread safety within gdImageStringFTEx
Task Type - Bug Report
Category - Freetype
Status - Unconfirmed
Assigned To - 
Operating System - All
Severity - High
Priority - Normal
Reported Version - 2.0.34
Due in Version - Undecided
Due Date - Undecided
Details - Already been reported in the PHP tracker but its slightly harder to fix in libGD since there is no real module initialisation option.

The problem is that the fontcache is checked to be empty, initialised and then locked. It's possible for the fontcache to be initialised between the empty check and creating it.

The reason it can't be locked prior to creating the cache is that the mutex is created within the code. It's fairly easy to fix but there is a good chance it breaks some form of backwards compatibility.

First fix is to make sure the mutex is only locked once, this is possible in pthread and by using DLLMain for Win32.

The attached patch addresses all of the issues but introduces the backwards compatibility break if gdFontCacheMutexSetup is not called..

More information can be found at the following URL:
http://bugs.libgd.org/?do=details&task_id=69

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.