crash at startup, possibly due to preferences.xml file

Bug #168086 reported by pjv
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Medium
Unassigned

Bug Description

Only if you're interested... I can fix this by
reinstalling but nevertheless Inkscape should never crash.

Steps: Just start the program and (apparently) have a
read-only preferences.xml file, then click "OK" when
the warning comes up, Inkscape will crash very hard ;-).

Output:
/home/pjv/.inkscape/preferences.xml:1: parser error :
Document is empty

^
/home/pjv/.inkscape/preferences.xml:1: parser error :
Start tag expected, '<' not found

^
*** glibc detected *** inkscape: double free or
corruption (!prev): 0x08771700 ***
======= Backtrace: =========
/lib/libc.so.6[0x439b36ff]
/lib/libc.so.6(__libc_free+0x8b)[0x439b422b]
/usr/lib/libglib-2.0.so.0(g_free+0x2c)[0x43c9eeef]
inkscape(_ZNK8Inkscape9Extension10Dependency5checkEv+0x17d)[0x83d92bd]
======= Memory map: ========
08048000-084f8000 r-xp 00000000 03:08 15974369
/usr/bin/inkscape
084f8000-08501000 rw-p 004b0000 03:08 15974369
/usr/bin/inkscape
08501000-08502000 rw-p 08501000 00:00 0
08503000-08597000 rw-p 004b8000 03:08 15974369
/usr/bin/inkscape
08597000-087e4000 rw-p 08597000 00:00 0 [heap]
43929000-43943000 r-xp 00000000 03:08 14409848
/lib/ld-2.4.so
43943000-43944000 r--p 00019000 03:08 14409848
/lib/ld-2.4.so
43944000-43945000 rw-p 0001a000 03:08 14409848
/lib/ld-2.4.so
43947000-43949000 r-xp 00000000 03:08 15016301
/lib/libutil-2.4.so
43949000-4394b000 rw-p 00001000 03:08 15016301
/lib/libutil-2.4.so
43950000-43a69000 r-xp 00000000 03:08 14515726
/lib/libc-2.4.so
43a69000-43a6b000 r--p 00118000 03:08 14515726
/lib/libc-2.4.so
43a6b000-43a6d000 rw-p 0011a000 03:08 14515726
/lib/libc-2.4.so
43a6d000-43a70000 rw-p 43a6d000 00:00 0
43a72000-43a95000 r-xp 00000000 03:08 14515745
/lib/libm-2.4.so
43a95000-43a97000 rw-p 00022000 03:08 14515745
/lib/libm-2.4.so
43a99000-43a9b000 r-xp 00000000 03:08 14515739
/lib/libdl-2.4.so
43a9b000-43a9d000 rw-p 00001000 03:08 14515739
/lib/libdl-2.4.so
43a9f000-43aae000 r-xp 00000000 03:08 7647367
/lib/libpthread-2.4.so
43aae000-43aaf000 r--p 0000f000 03:08 7647367
/lib/libpthread-2.4.so
43aaf000-43ab0000 rw-p 00010000 03:08 7647367
/lib/libpthread-2.4.so
43ab0000-43ab2000 rw-p 43ab0000 00:00 0
43ab4000-43ab6000 r-xp 00000000 03:08 14515784
/usr/lib/libXau.so.6.0.0
43ab6000-43ab7000 rw-p 00001000 03:08 14515784
/usr/lib/libXau.so.6.0.0
43ab9000-43ac5000 r-xp 00000000 03:08 14515740
/usr/lib/libz.so.1.1.4
43ac5000-43ac7000 rw-p 0000b000 03:08 14515740
/usr/lib/libz.so.1.1.4
43ac9000-43b94000 r-xp 00000000 03:08 14515786
/usr/lib/libX11.so.6.2.0
43b94000-43b99000 rw-p 000ca000 03:08 14515786
/usr/lib/libX11.so.6.2.0
43b9b000-43ba0000 r-xp 00000000 03:08 14515785
/usr/lib/libXdmcp.so.6.0.0
43ba0000-43ba1000 rw-p 00004000 03:08 14515785
/usr/lib/libXdmcp.so.6.0.0
43ba3000-43bb1000 r-xp 00000000 03:08 14515787
/usr/lib/libXext.so.6.4.0
43bb1000-43bb2000 rw-p 0000d000 03:08 14515787
/usr/lib/libXext.so.6.4.0
43bdc000-43c4a000 r-xp 00000000 03:08 13667497
/usr/lib/libfreetype.so.6.3.8
43c4a000-43c4d000 rw-p 0006e000 03:08 13667497
/usr/lib/libfreetype.so.6.3.8
43c4f000-43c56000 r-xp 00000000 03:08 13667490
/usr/lib/libXi.so.6.0.0
43c56000-43c57000 rw-p 00006000 03:08 13667490
/usr/lib/libXi.so.6.0.0
43c59000-43c77000 r-xp 00000000 03:08 14658625
/usr/lib/libexpat.so.0.5.0
43c77000-43c79000 rw-p 0001d000 03:08 14658625
/usr/lib/libexpat.so.0.5.0
43c7b000-43cee000 r-xp 00000000 03:08 14515765
/usr/lib/libglib-2.0.so.0.1000.3
43cee000-43cef000 rw-p 00073000 03:08 14515765
/usr/lib/libglib-2.0.so.0.1000.3
43cf1000-43cf9000 r-xp 00000000 03:08 13667501
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.4.6/libgcc_s.so.1
43cf9000-43cfa000 rw-p 00007000 03:08 13667501
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.4.6/libgcc_s.so.1
43cfc000-43d23000 r-xp 00000000 03:08 14658630
/usr/lib/libfontconfig.so.1.0.443d23000-43d28000 rw-p
00027000 03:08 14658630
/usr/lib/libfontconfig.so.1.0.443d28000-43d29000 rw-p
43d28000 00:00 0
43d2b000-43d48000 r-xp 00000000 03:08 14658388
/usr/lib/libpng12.so.0.12.0
43d48000-43d49000 rw-p 0001c000 03:08 14658388
/usr/lib/libpng12.so.0.12.0
43d4b000-43d53000 r-xp 00000000 03:08 14658387
/usr/lib/libXrender.so.1.3.0
43d53000-43d54000 rw-p 00007000 03:08 14658387
/usr/lib/libXrender.so.1.3.0
43d56000-43d84000 r-xp 00000000 03:08 14515769
/usr/lib/libgobject-2.0.so.0.1000.3
43d84000-43d85000 rw-p 0002e000 03:08 14515769
/usr/lib/libgobject-2.0.so.0.1000.3
43d87000-43d90000 r-xp 00000000 03:08 15005302 /usr/lib/l
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.

Revision history for this message
Horkana-users (horkana-users) wrote :

> Only if you're interested... I can fix this by
> reinstalling but nevertheless Inkscape should never crash.
>
> Steps: Just start the program and (apparently) have a
> read-only preferences.xml file, then click "OK" when
> the warning comes up, Inkscape will crash very hard ;-).
>
> Output:
> /home/pjv/.inkscape/preferences.xml:1: parser error :
> Document is empty

Agreed, inkscape should be uncrashable at least in theory.
In practise making it uncrashable might be impractical and
far more time consuming than it is worth.

at a glance it looks like your problem could have been fixed
by deleting or otherwise removing your inkscape
preferences.xml file rather than needing a full reinstall.
(should add that to the FAQ as a big thing to try when
troubleshooting startup errors.)

When you say "apparently read only" have you tested this
theory by deliberately setting the file as read-only?

Do you have a copy of the dodgy preferences.xml file that
caused this problem?

Revision history for this message
pjv (pjv) wrote :

In that case I'll close the bug. I haven't checked the file
nor kept it, I just reinstalled it (hey it's my time
consumption too). One would imagine though that it shouldn't
be so hard to locat the crash. Do you actually handle a
buggy preferences.xml in the code? I assume that indeed an
original file would have mended it also.

Bye

Revision history for this message
Horkana-users (horkana-users) wrote :

Leaving open for now, a good developer might be able to make
more use of this (or decide to close it anyway but i do
think this is a worthwhile report).
I suppose they should be able to add extra checks so that
Inkscape can still load even if the prefences.xml is not
found or found but corrupt, and provide a half ways
intelligable error message while doing so.

my comments may have seemed harsh when that was not my
intention. I was just trying to reflect the general idea
that applications shouldn't be crashable which I strongly
agree with and I believe most programmers do too but that
the extra effort required to do so means it doesn't often
happen.

Revision history for this message
pjv (pjv) wrote :

No hard feelings. Again: this is just for your information.
My main cooncern (unfortunately) was just to get it to work.

Greetz

Revision history for this message
Bryce Harrington (bryce) wrote :

Originator: NO

On Linux using latest from SVN, I did not reproduce the error, but did see
some other odd behavior:

1. chmod a-w ~/.inkscape/preferences.xml; src/inkscape

Expected a warning when starting up about read-only preferences file, but
program started without any warnings via dialog or to console.

Modified inkscape preferences, and then exected. Expected warning about
'cannot save preference settings', but no warning was given. On restarting
Inkscape, the preferences were set back to original (changes were lost.)

2. mv ~/.inkscape/preferences.xml /tmp; touch
~/.inkscape/preferences.xml; src/inkscape

Received a number of warnings. To the console:

/home/bryce/.inkscape/preferences.xml:1: parser error : Document is empty

^
/home/bryce/.inkscape/preferences.xml:1: parser error : Start tag
expected, '<' not found

^

To the screen a warning dialog:

s given. On restarting Inkscape, the preferences were set back to
original (changes were lost.)

2. mv ~/.inkscape/preferences.xml /tmp; touch
~/.inkscape/preferences.xml; src/inkscape

Received a number of warnings. To the console:

/home/bryce/.inkscape/preferences.xml:1: parser error : Document is empty

^
/home/bryce/.inkscape/preferences.xml:1: parser error : Start tag
expected, '<' not found

^

To the screen a warning dialog:

/home/bryce/.inkscape/preferences.xml not a valid XML file, or
you don't have read permissions on it.
Inkscape will run with default settings.
New settings will not be saved.

I think the warning dialog should be sufficient. Also, the warning dialog
should be more specific. If the preferences file is not valid, it should
say it's "not a valid Inkscape preferences file." or if the permissions are
wrong, it should say that permissions are to blame.

Revision history for this message
nightrow (jb-benoit) wrote :

Bryce, your thoughts about this bug labelled as new (you were the last to post about it) ?

Revision history for this message
Bryce Harrington (bryce) wrote :

The odd behaviors I experienced probably aren't worth keeping this as a bug. An empty preferences.xml should generate errors, and the ones it does generate are appropriate. A dialog would be nice, but this is such an unusual case it's probably not even worth coding. Closing as invalid.

Changed in inkscape:
status: New → Invalid
Revision history for this message
Denis Darii (dnx) wrote :

As a solution for this problem, you can write inside that file the following six lines:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<inkscape
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   version="0.44.1">
</inkscape>

Be careful to replace version="x.xx.x" with your version of inkscape, e.x. version="0.44.1".

After this, run inkscape. We think inkscape to modify the files to his liking.
I attach the file for those who do not want to write.

Enjoy inkscape...

To post a comment you must log in.
This report contains Public information  
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.