Manual talk:$wgMaxShellMemory


Error creating thumbnail: Invalid thumbnail parameters[edit]


The default value of $wgMaxShellMemory in MW1.19.2 is too low for SVG thumbnail rendering.

The Error message produced by a value too low is far too obtuse:

Error creating thumbnail: ERROR: meta.c (179): wmf_header_read: this isn't a wmf file convert: Delegate failed `"wmf2svg" -o "%o" "%i"'. convert: unable to open image `/tmp/magick-XXn4EQJ3': No such file or directory. convert: unable to load module `/usr/lib64/ImageMagick-6.2.8/modules-Q16/coders/': failed to map segment from shared object: Cannot allocate memory. convert: unable to open file `/tmp/magick-XXn4EQJ3': No such file or directory. convert: missing an image filename `PNG:/tmp/transform_402f06e-1.png'.

Setting $wgMaxShellMemory to 300000 FIXED IT. (Thanks folks on Mediawiki-l for the tip! I would never have thought of this!)

Caution: This is LINUX only! Won't work with POSIX like systems e.g. FreeBSD[edit]

Hi everyone,

the function wfShellExec()[1]checks OS for "Linux" before using "", so for example FreeBSD won't use any ulimit here. This will fail sooner or later.

Someone[tm] should[tm] create a patch for and wfShellExec() to enable ulimits for any POSIX aware operating system having a /bin/sh. Bug report will follow. --Rabe (talk) 10:06, 26 April 2013 (UTC)[reply]

I patched this for my system and verified it by getting a memory allocation error now:
 Fehler beim Erstellen des Vorschaubildes: convert: memory allocation failed `/data/www/wiki.*****.org/secure/images/1/1b/FreeBSD_System_verschluesseln_mit_geli(8)_Diagramm.svg' @ error/svg.c/ReadSVGImage/2968.
convert: no images defined `PNG:/data/www/wiki.*****.org/secure/images/temp/transform_28149c237e88-1.png' @ error/convert.c/ConvertImageCommand/3078.
The Community should check my patches (especially on Linux), see Bug 47781.
Regards --Rabe (talk) 22:24, 26 April 2013 (UTC)[reply]
BugReport, please review and comment! --Rabe (talk) 19:37, 27 April 2013 (UTC)[reply]


Note about minimum size[edit]

The docs should really note that in some situations (such as when the CheckSyntax::getGitModifiedFiles() function is called from the Maintenance script) the the value of $wgMaxShellMemory is automatically bumped to '1024000' if it's set to anything lower than that.

private function getGitModifiedFiles( $path ) {
    $oldMaxShellMemory = $wgMaxShellMemory;
    if ( $wgMaxShellMemory < 1024000 ) {
        $wgMaxShellMemory = 1024000;

This is an important thing to leave out... --CyberXRef 00:38, 15 February 2014 (UTC)[reply]