MediaWiki で inkscape を用いて SVG (scalable vector graphics) のサムネイルを作る設定をしていたのだが,inkscape の version を jessie の backports のもの (0.48.5-3 -> 0.92.0-4~bpo8+1)にしたらうまく動かなくなった.
Error creating thumbnail:
(process:2380): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
Failed to get connection
** (inkscape:2380): CRITICAL **: dbus_g_proxy_new_for_name: assertion 'connection != NULL' failed
** (inkscape:2380): CRITICAL **: dbus_g_proxy_call: assertion 'DBUS_IS_G_PROXY (proxy)' failed
** (inkscape:2380): CRITICAL **: dbus_g_connection_register_g_object: assertion 'connection != NULL' failed
** (inkscape:2380): WARNING **: GC Warning: Out of Memory! Heap size: 2 MiB. Returning NULL!
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Emergency save activated!
Emergency save completed. Inkscape will close now.
If you can reproduce this crash, please file a bug at www.inkscape.org
with a detailed description of the steps leading to the crash, so we can fix it.
** Message: Error: Inkscape encountered an internal error and will close now.
/somewhere/mediawiki/includes/limit.sh: line 101: 2379 Aborted /usr/bin/timeout $MW_WALL_CLOCK_LIMIT /bin/bash -c "$1" 3>&-
どうやら shell を起動する際にメモリサイズを制限しているらしく,そこで引っかかっているらしい./etc/mediawiki/LocalSettings.php
で$wgMaxShellMemory
という変数で設定するが,https://www.mediawiki.org/wiki/Manual:$wgMaxShellMemoryによると default は 307200 KB = 300 MB.inkscape がメモリを喰いすぎな気もする.以下のように500 MBに設定すれば動くようになった.
[/etc/mediawiki/LocalSettings.php]
$wgMaxShellMemory = 512000;