Converting from SVG in command line results in an infinite wait

Bug #1353797 reported by szotsaki on 2014-08-07
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Undecided
Unassigned

Bug Description

MediaWiki uses "convert" app by default to convert from SVG to PNG which in turn calls Inkscape. Somehow it gets stuck when MW starts its script.

Here is what happens exactly:
- MW calls wiki/includes/limit.sh to convert from SVG to PNG
- limit.sh executes the following: `eval "$1" 3>&-` where $1 is `convert -background white -thumbnail 850x850\! '[...]/images/0/06/Max_független_gráf.svg' PNG:'/tmp/transform_f01590c08065-1.png'`
- convert calls "sh" with the following: `sh -c "inkscape" "[...]/images/0/06/Max_független_gráf.svg" --export-png="/tmp/magick-12283jsqHDPhM5VON" --export-dpi="90,90" --export-background="rgb(100%,100%,100%)" --export-background-opacity="1" > "/tmp/magick-12283L4SS7ae5fNZJ" 2>&`

Inkscape has two threads:
  Id Target Id Frame
  2 Thread 0x7f4c08912700 (LWP 12286) "inkscape" pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
* 1 Thread 0x7f4c19dc0a40 (LWP 12285) "inkscape" pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185

The first one:
#0 pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1 0x00007f4c15d29507 in g_cond_wait (cond=cond@entry=0x7f4c15fa04c0 <g_once_cond>, mutex=mutex@entry=0x7f4c15fa04d0 <g_once_mutex>) at gthread-posix.c:753
#2 0x00007f4c15d0e18b in g_once_init_enter (location=location@entry=0x7f4c15fa0540 <home_dir.12794>) at gthread.c:683
#3 0x00007f4c15d19118 in g_get_home_dir () at gutils.c:883
#4 0x00007f4c15d1924c in g_init_user_config_dir () at gutils.c:1269
#5 0x00007f4c15d198ed in g_init_user_config_dir () at gutils.c:1311
#6 g_get_user_config_dir () at gutils.c:1306
#7 0x000000000066c1c2 in profile_path (filename=filename@entry=0x0) at inkscape.cpp:1457
#8 0x0000000000678026 in Inkscape::Preferences::Preferences (this=0x25771d0) at preferences.cpp:90
#9 0x000000000066c9ed in get () at preferences.h:448
#10 inkscape_application_init (argv0=0x7fff038a9e1d "inkscape", use_gui=use_gui@entry=0) at inkscape.cpp:802
#11 0x0000000000650675 in sp_main_console (argc=6, argv=0x7fff038a9a88) at main.cpp:1167
#12 0x000000000071db0e in Inkscape::NSApplication::Application::run (this=this@entry=0x7fff038a9940) at application/application.cpp:117
#13 0x000000000063463f in main (argc=6, argv=0x7fff038a9a88) at main.cpp:714

The second one:
#0 pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1 0x00007f4c13b4c597 in GC_wait_marker () at pthread_support.c:1920
#2 0x00007f4c13b4356a in GC_help_marker (my_mark_no=1) at mark.c:1176
#3 0x00007f4c13b4aadf in GC_mark_thread (id=<optimized out>) at pthread_support.c:397
#4 0x00007f4c148180db in start_thread (arg=0x7f4c08912700) at pthread_create.c:309
#5 0x00007f4c12a3f90d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Somehow at this point nothing happens any more, it's just waiting for something forever.

The most interesting part is when I manually `eval` the command `/bin/bash /srv/www/htdocs/wiki/includes/limit.sh "LANG='en' convert -background white -thumbnail 850x850\! '[...]/images/0/06/Max_független_gráf.svg' PNG:'/tmp/transform_f01590c08065-1.png'"` in the name of the wwwrun user, everything runs smoothly in a fraction of a second. But when it started from MediaWiki PHP script, Inkscape hangs.

OS: openSUSE 13.1
Inkscape: 0.48.4 r9939

su_v (suv-lp) wrote :

Possibly related to bug #376866 (missing $HOME or not sufficient priviledges for the user under which the the PHP script runs) ?

szotsaki (szotsaki) wrote :

Yes, I think so it has some relation to the $HOME, especially because of the stack trace: Inkscape::Preferences::Preferences > profile_path > g_init_user_config_dir > g_get_home_dir.

jazzynico (jazzynico) on 2014-08-08
tags: added: cli crash
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers