Bug #24313
closedCircular dependency in gm
0%
Description
We have a high traffic typo3 page that is within a multi node cluster, each cluster sharing a common device via iSCSI and a network file system.
Randomly (from 1x within 48 hours to 4x a day), one node hangs because GM is taking 100% cpu power. the node gets fenced (rebooted) by other nodes to make the network file system clear (its a security mechanism from ocfs2).
I was lucky to catch a shot at ps aux:
typo3 856 0.0 0.0 53484 2444 ? D 14:28 0:00 /usr/bin/gm convert +profile * typo3temp/pics/ob4_4d563cbc2c.gif typo3temp/pics/ob4_4d563cbc2c.gif
typo3 857 99.2 0.0 53340 2196 ? R 14:28 0:55 /usr/bin/gm convert +profile * typo3temp/pics/ob4_4d563cbc2c.gif typo3temp/pics/ob4_4d563cbc2c.gif
Network filesystems have a very hard policy on locking and thats imho why the circular dependency in the second case is hanging gm. Readlock and writelock on the same file doesnt really make sense.
Can this be a typo3 bug in the specified version? Is there any work around for this?
safe_mode = off
os = gentoo
typo3 = 4.3
gm = 1.3.12
php = 5.2.12
(issue imported from #M16707)
Files
Updated by Jigal van Hemert almost 14 years ago
I suspect it comes from t3lib_div::gif_compress(). This function uses IM/GM (or GD) to compress a gif file. It was the only function I could find which uses no other operations and uses the same file as input and output file.
I'll make a patch for this in the next few days. If this works for you I will submit it for review to the core list.
Updated by Jigal van Hemert almost 14 years ago
Attached a patch for trunk (16707.patch) and one for version 4.3 (16707_4-3.patch).
Can you test it on your system with a network file system?
Please also verify that gif_compress is used; in the Install Tool in the Image Processing section, start Writing GIF and PNG. Below the Write GIF test you should see a message like:
Note on gif_compress() function:
The 'gif_compress' method used was 'IM'.
Previous filesize: 21 K. Current filesize:21 K
Only if the method is 'IM' (GM is also reported as method 'IM') this patch is active.
Updated by Jrgen Ladsttter almost 14 years ago
Yes that works - thanks a lot for the fix