GNOME Bugzilla – Bug 447063
eog hangs when opening SVG files that include external images
Last modified: 2007-09-05 10:25:30 UTC
- Download the following SVG and the TIF file that is included by the SVG: http://www.om.tu-harburg.de/eogbug/test.svg http://www.om.tu-harburg.de/eogbug/n_.tif - Put the files in the same directory, cd into that directory, and run 'eog test.svg'. - Nothing happens, eog just hangs. This is not so bad, I don't usually use eog from the shell. BUT: The main problem is that nautilus hangs when I enter the directory containing the above-mentioned SVG. I think that's because nautilus calls eog to get the preview image, but eog never returns. This is very annoying, because I have to restart nautilus.
Confirming. There appears to be a deadlock somewhere:
+ Trace 140596
Okay, we seem to be hitting two problems here. The first one comes from gdk-pixbuf. Here the SVG-loader sets a lock which the TIFF-loader needs to set as well and thus deadlocks as it is called from inside the SVG-loader. (See bug 449409 for more information). The second one is that you need to start eog from the directory where your image file is located as it wont find the embedded image otherwise.
I refactored Felix' patch (Thanks Felix!) on bug #449409 and it really seems to work around this non-threadsafe loader problem. Fixed in trunk. 2007-09-04 Lucas Rocha <lucasr@gnome.org> * src/eog-image-private.h: added threadsafe_format private attribute. * src/eog-image.c (+eog_image_pre_size_prepared, eog_image_size_prepared, eog_image_real_load): detect non-threadsafe loaders and disable any possible asyncronous task that could bring deadlocks to image loading process. Fixes bug #449409 (Felix Riemann).
Lucas, are you sure this is fixed? It is still (expectedly) hanging here. The first problem (loading an SVG while realizing the window) is fixed, but the next that happens is that librsvg uses GdkPixbufLoader itself to load the embedded/referenced TIFF file. This produces the same deadlock as before (to thread-unsafe loaders at the same time), but there is probably nothing here we can do against it (as it is out of EOG's scope).
This patch is a good-enough work around for the most critical problem of basic image loading with non-threadsafe loaders. The remaining (major) bug should be kept in separate report for gdk-pixbuf (See bug #473862).