trunk: crash if document with linked color profile uses spaces in file name (rev >= 13107)

Bug #1297557 reported by su_v
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
jazzynico

Bug Description

Files with a linked color profile and a file name containing spaces crash on load, independent of whether the linked profile exists on the local system or not.

Steps to reproduce:
1) open attached sample file in current trunk
(the file is empty, the only modification is a linked color profile)

--> crash
terminate called after throwing an instance of 'Inkscape::MalformedURIException'
  what(): Malformed URI

Based on tests with archived builds on OS X 10.7.5:
- not reproduced with rev <= 13104
- reproduced with rev >= 13107;
this regression is related to the removal of 'src/dom' in revision 13107:
<http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/13107>

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

No crash with this file. Only difference:

$ diff Filename\ with\ spaces.svg Filename-without-spaces.svg
19c19
< sodipodi:docname="Filename with spaces.svg">
---
> sodipodi:docname="Filename-without-spaces.svg">

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

Crash reproduced with Inkscape 0.48+devel r13212 on Ubuntu 13.10 (VM, 64bit).

description: updated
Changed in inkscape:
status: New → Confirmed
Revision history for this message
su_v (suv-lp) wrote :

Also affects documents with special characters in the file name:

$ diff Filename-without-spaces.svg Filename-without-spaces-but-special-c\314-characters.svg
19c19
< sodipodi:docname="Filename-without-spaces.svg">
---
> sodipodi:docname="Filename-without-spaces-but-special-ç-characters.svg">

Same crash with 'Filename-without-spaces-but-special-ç-characters.svg'.

Revision history for this message
jazzynico (jazzynico) wrote :

Also reproduced on Crunchbang Waldorf, Inkscape trunk revision 13220.

Changed in inkscape:
status: Confirmed → Triaged
jazzynico (jazzynico)
Changed in inkscape:
assignee: nobody → jazzynico (jazzynico)
status: Triaged → In Progress
Revision history for this message
jazzynico (jazzynico) wrote :

Patch attached.

The document URI creation calls a constructor that accepts preformed path only, and with give it a file path instead.
The patch should fix it by converting the path to a real URI directly (with the from_native_filename() function available in uri.cpp).

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

Patch tested successfully r13248 on OS X 10.7.5, with lcms (1.19) and lcms2 (2.4) with the test cases mentioned here.

Working with color profiles however does still seem rather unstable to me - several crashes occurred while testing with files which link to color profiles which don't exist on the local system (e.g. when attempting to use a linked but missing profile in 'Fill & Stroke' (lcms2 only) , another one with multiple documents in the same session (unclear what triggered it)). Probably better to discuss in separate reports …

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

> Patch tested successfully r13248 on OS X 10.7.5, with lcms (1.19) and lcms2 (2.4)

Retracting - it seems that the patched build now crashes when linking a profile into a new, not yet saved document (works ok with current trunk). AFAICT only affects builds with lcms2.

tags: added: color
Revision history for this message
jazzynico (jazzynico) wrote :

This one should work in both cases.

Revision history for this message
jazzynico (jazzynico) wrote :

(Tested on Windows XP, Inkscape trunk revision 13248 and lcms2 only)

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

Reproducible crash while testing second version of patch with r13248 on OS X 10.7.5, with lcms2 (2.4):

Steps to reproduce:
1) launch patched trunk build (default prefs, new doc)
2) open 'Document Properties > Color' and link a color profile to current doc
3) save file and close window
4) open just saved file from 'File > Open recent'

--> crash:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
0x000000010071cdec in Inkscape::XML::SignalObserver::set (this=0x112260710, o=0x140cdc1f0) at ../../src/xml/helper-observer.cpp:18
18 _oldsel->getRepr()->removeObserver(*this);

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

Sorry, crash happens with unpatched r13248 too:

Steps to reproduce:
1) launch patched trunk build (default prefs, new doc)
2) save file (Shift+Ctrl+S)
3) open 'Document Properties > Color' and link a color profile to current doc
4) close window
4) open just saved file from 'File > Open recent'

Probably better tracked in a separate report.

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

> Probably better tracked in a separate report.
See bug #1300959 “trunk: crash when reloading a file with linked color profile”

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

Second version of patch tested successfully with r13248+patch (lcms1, lcms2; OS X 10.7.5): file names with spaces, with special characters, linking a color profile in unsaved document - all work without crash.

Revision history for this message
jazzynico (jazzynico) wrote :

Patch committed revision 13249.
At least that bug won't interfere with the other color profile related bugs...

Changed in inkscape:
milestone: 0.91 → none
status: In Progress → Fix Released
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.