GD is an open source code library for the dynamic creation of images by programmers. GD is written in C, and “wrappers” are available for Perl, PHP and other languages. GD creates PNG, JPEG and GIF images, among other formats. GD is commonly used to generate charts, graphics, thumbnails, and most anything else, on the fly. While not restricted to use on the web, the most common applications of GD involve web site development.
See the GD website for more informations.
FS#69 — Race condition / thread safety within gdImageStringFTEx
Opened by Scott MacVicar (ScottMac) - Wednesday, 04 April 2007, 02:36 GMT+2
Last edited by Pierre Joye (Pierre) - Monday, 28 April 2008, 11:04 GMT+2
|
DetailsAlready 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. |
libgd-mutex-patch.txt