Inkscape crashes when converting file on commandline

Bug #1170248 reported by p-s on 2013-04-18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bryce Harrington
inkscape (Debian)
Fix Released

Bug Description

When I try to run the following command on linux shell inkscape (0.48.4) segfaults.
The critical is LC_MESSAGES=cs_CZ, when LC_MESSAGES is english or unset inkscape proceeds.
Seems like non ascii chars are put to file, however LC_MESSAGES should change only UI and no file data I think.

$ LC_MESSAGES=cs_CZ inkscape --file="0_5.svg" --export-area-drawing --without-gui --export-pdf="0_5.pdf"
Entity: line 13: parser error : Input is not proper UTF-8, indicate encoding !
Bytes: 0xE1 0x74 0x20 0x47
<filetypetooltip>Formát GdkPixdata</filetypetooltip>

** (inkscape:20811): CRITICAL **: Inkscape::Extension::Extension* Inkscape::Extension::build_from_reprdoc(Inkscape::XML::Document*, Inkscape::Extension::Implementation::Implementation*): assertion `doc != NULL' failed

Emergency save activated!
Emergency save completed. Inkscape will close now.
If you can reproduce this crash, please file a bug at
with a detailed description of the steps leading to the crash, so we can fix it.
** Message: Error: V aplikaci Inkscape došlo k vnitřní chybě a bude nyní uzavřena.

Segmentation fault

jazzynico (jazzynico) on 2013-06-27
tags: added: cli crash exporting pdf
Changed in inkscape:
importance: Undecided → High
jazzynico (jazzynico) wrote :

Not reproduced on Windows XP, Inkscape 0.48.4 and trunk revision 12387, language set to fr_FR and cs_CZ.

Could you please attach the file that fails to convert so that we could investigate?

Changed in inkscape:
status: New → Incomplete
p-s (3-pc-o) wrote :

I don't think the file will help but here you have it.

My intuition is that for some reason inkscape wrongly uses language of UI and put it into data stream, namely into <filetypetooltip>. But then, because I don't run UTF-8 but ISO-8859-2 encoding inkscape choke on the UI string itself produced.

I'm not sure what translation machinery for UI you use but in case of gettext I wouldn't be surprised that you can't reproduce, gettext is tough creature on windows. Even on linux you need to setup locale correctly first so that LC_MESSAGES=cs_CZ work.
fr_FR might not help if translation of the word Format does not contain some non ascii char.

p-s (3-pc-o) wrote :
Kris (kris-degussem) on 2013-08-20
Changed in inkscape:
status: Incomplete → New
su_v (suv-lp) wrote :

Testing with current trunk r12841 on OS X 10.7.5:
- not reproduced with locale "cs_CZ.UTF-8"
- reproduced with locale "cs_CZ.ISO8859-2"

(backtrace attached)

Bryce Harrington (bryce) wrote :

Since the XML being passed in is not properly encoded, sp_repr_read_mem() fails to parse the file and crashes. I've pushed a fix that handles the error instead.

This doesn't completely fix the problem though. The tooltips certainly can be unicode text. I suspect the CZ translation simply isn't marking the string properly.

Bryce Harrington (bryce) wrote :

Debian bug #369706 seems to be suggesting the issue was caused by libgc1c2 version 1:6.7-1 and that by downgrading to 6.6-2 the issue should be resolved. That bug has a bunch of additional analysis that would be worth reviewing.

Changed in inkscape (Debian):
status: Unknown → Fix Released
su_v (suv-lp) on 2015-02-12
tags: added: encoding
su_v (suv-lp) wrote :
Changed in inkscape:
assignee: nobody → Bryce Harrington (bryce)
milestone: none → 0.91
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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