Project

General

Profile

Actions

Bug #24313

closed

Circular dependency in gm

Added by Jrgen Ladsttter over 13 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2010-12-09
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.3
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

16707_4-3.patch (1.09 KB) 16707_4-3.patch Administrator Admin, 2010-12-12 10:10
16707.patch (1.11 KB) 16707.patch Administrator Admin, 2010-12-12 10:10
16707_4-4.patch (1.09 KB) 16707_4-4.patch Administrator Admin, 2010-12-12 21:05
Actions #1

Updated by Jigal van Hemert over 13 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.

Actions #2

Updated by Jigal van Hemert over 13 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.

Actions #3

Updated by Jrgen Ladsttter over 13 years ago

Yes that works - thanks a lot for the fix

Actions #4

Updated by Jigal van Hemert over 13 years ago

Patch pending in core list.

Actions #5

Updated by Jigal van Hemert over 13 years ago

Committed to trunk rev: 9981

Actions #6

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF