Crash due to re-registering GdkPixbufGdipAnim during BMP read

Bug #1467103 reported by Daniel Beardsmore
170
This bug affects 22 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Critical
Patrick Storz
Inkscape Devlibs for Windows 64-bit
Fix Committed
Undecided
Patrick Storz

Bug Description

Visible fault:

Inkscape cannot read a Windows bitmap (BMP) file subsequent to opening an SVG file with an embedded raster object. Attempting to do so causes the program to simply disappear from the screen without warning.

To reproduce:

1) Open an SVG containing a raster object (any BMP/PNG/JPG etc already imported and embedded into the image), either with File → Open, or by starting Inkscape by double-clicking an SVG file in Windows Explorer/File Explorer

2) Try to import a BMP file using any of the methods below, either into the same document, or into a new document (after File → New):
  a) Drop a BMP file onto the image
  b) File → Import, click image (with thumbnail panel active in Open dialog) — crashes inside the Open dialog when showing the thumbnail prior to clicking Open
  c) File → Import, click image, click Open (with thumbnail panel hidden) — crashes during import

Cause:

It appears the SVG image read process registers GdkPixbufGdipAnim when the image contains a raster object, as does reading a Windows BMP (but not PNG/JPG). Trying to re-register this type during a BMP read subsequent to reading an SVG document fails, causing the program to terminate.

Output from inkscapec.exe:

(inkscape.exe:5152): GLib-GObject-WARNING **: cannot register existing type 'GdkPixbufGdipAnim'

(inkscape.exe:5152): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed

(inkscape.exe:5152): GLib-GObject-CRITICAL **: g_object_new: assertion 'G_TYPE_IS_OBJECT (object_type)' failed

Setup:

Inkscape 0.91 r13725 64-bit (from inkscape 0.91 pre 2 x64.msi)
Windows 8.1 Pro 64-bit

Revision history for this message
su_v (suv-lp) wrote :
tags: added: bitmap crash win64
Changed in inkscape:
importance: Undecided → High
Revision history for this message
su_v (suv-lp) wrote :

Earlier report which are likely shares the same underlying issue:
* Bug #1447012 “crash while importing jpg and tiff images in the same drawing”

Revision history for this message
Daniel Beardsmore (telcontar) wrote :

Bug #1447012 is the same fault -- the same output is generated in inkscapec.exe, and the crash occurs inside the Open dialog box when clicking on the image to be imported, i.e. at the point that Inkscape first tries to read the image, causing the program to disappear.

su_v (suv-lp)
Changed in inkscape:
milestone: none → 0.92
status: New → Triaged
Revision history for this message
su_v (suv-lp) wrote :

On 2015-06-20 16:03 (+0200), ~suv wrote:
> ** Also affects: inkscape-devlibs64

JFTR - I added inkscape-devlibs64 because of the workaround described in the linked redhat bug report:

<quote>
As a downstream, I guess we could compile all the GDI+ loaders into the main gdk-pixbuf DLL, which should fix the static variable problem. Another way to fix it would be to just stop using the GDI+ loaders.
</quote>

Revision history for this message
su_v (suv-lp) wrote :

Raising Importance to 'Critical' due to loss of data (no emergency save).

AFAIU this needs fixing in how gdk-pixbuf in the 64bit devlibs is configured and compiled (not a change in Inkscape's own code). Builds using the current 32bit devlibs are not affected because there the gdk-pixbuf loaders are compiled in.

Changed in inkscape:
importance: High → Critical
Revision history for this message
Patrick Storz (ede123) wrote :

Was anybody able to reproduce this bug with the steps described in the initial report?

I just tried to verify the devlib64 update will fix this issue but I can't even reproduce it with the released stable version of Inkscape 0.91 win64.

If somebody can reliably reproduce it please post steps and sample files that can be used to trigger the crash!

Revision history for this message
Daniel Beardsmore (telcontar) wrote :

Funny, I was having this crash only a couple of days ago. I've attached a JPG image, after which I'll add a GIF image. If you launch Inkscape, then drag either image into the window to embed it, and then do the same with the second image, the program disappears from the screen. It doesn't matter whether you embed the GIF first, or the JPG first.

I can add either type repeatedly without issue, but the crash occurs when embedding a second type of image. e.g. I can add JPG after JPG after JPG, but the first GIF or PNG it sees crashes it, simply because it's a different format. Likewise, embed lots of GIFs, and then a JPG, at which point it crashes.

Revision history for this message
Daniel Beardsmore (telcontar) wrote :
Revision history for this message
Patrick Storz (ede123) wrote :

Great, thanks... I tried to import a BMP into an SVG already containing an embedded PNG before which apparently does not trigger the crash. Mixing BMP and JPG does the trick however.

Anyway good news is that the crash does not seem to occur with builds based on the updated devlibs64. If you like you can grab a recent build from [1] and confirm that it fixes the issue for you.

[1] https://drive.google.com/folderview?id=0B3IZiqBj23X1My1CaUE2NjlpVms#list

Revision history for this message
Daniel Beardsmore (telcontar) wrote :

It appears to be fixed for me, yes, thank you.

Revision history for this message
Patrick Storz (ede123) wrote :

Fixed with the major update of inkscape-devlibs64 in revision 19.

gdk-pixbuf is compiled without GDI loaders (configure option --without-gdiplus)
Alternatively it should also work to use --disable-modules (which builds all loaders statically into the gdk-pixbuf library )

Changed in inkscape:
assignee: nobody → Eduard Braun (eduard-braun2)
Changed in inkscape-devlibs64:
assignee: nobody → Eduard Braun (eduard-braun2)
status: New → Fix Committed
Changed in inkscape:
status: Triaged → Fix Committed
Changed in inkscape-devlibs64:
assignee: Eduard Braun (eduard-braun2) → nobody
assignee: nobody → Eduard Braun (eduard-braun2)
Revision history for this message
Patrick Storz (ede123) wrote :

Just for the sake of completeness:
The correct configure switch for gdk-pixbuf is --with-included-loaders, NOT --disable-modules as is wrote above. The latter only disables dynamic loading of modules altogether, but does not include any of them into the library.

I updated devlibs64 with gdk-pixbuf configured like this in r32 [2] and it seems to work nicely.

[2] http://bazaar.launchpad.net/~inkscape.dev/inkscape-devlibs64/trunk/revision/32

Revision history for this message
dryphi (dryphi) wrote :

I'm having this problem using Inkscape 0.91 r13725 (64 bit) on Windows 10.
Any way to solve it on Windows? When will this make it into an installer release? I'm not familiar with compiling, is there a beta I could download?
Thanks

Revision history for this message
Alvin Penner (apenner) wrote :

you could get a more recent build at:
https://inkscape.org/en/download/development-versions/

Revision history for this message
Daniel Beardsmore (telcontar) wrote :

The workaround is to re-save your images as PNG prior to importing them. I'd forgotten that PNG wasn't affected, as I'd been mentally noting for a while that this bug seems to have cured itself. It just so happens that I typically import PNG images!

Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.