Crash when opening files (Glib::ConvertError exception)

Bug #1404934 reported by Alban Browaeys on 2014-12-22
84
This bug affects 12 people
Affects Status Importance Assigned to Milestone
Inkscape
High
Riccardo Bernardini

Bug Description

I open my document via File>Open Recent. Then crash occurs.
( I had the document moved then opened in inkscape via nautilus.)
The program outputs:
"
terminate called after throwing an instance of 'Glib::ConvertError'

Emergency save activated!
Emergency save completed. Inkscape will close now.
"

It turns out my $HOME/.local/share/recently-used.xbel has this block added coincidentaly around the time the issue appeared. Removing it fix inkscape use case from above.
"
  <bookmark href="file:$HOME" added="2014-12-21T23:27:17Z" modified="2014-12-21T23:27:17Z" visited="2014-12-21T23:27:17Z">
    <info>
      <metadata owner="http://freedesktop.org">
        <mime:mime-type type="application/octet-stream"/>
        <bookmark:applications>
          <bookmark:application name="nautilus" exec="&apos;bdbvu %U&apos;" modified="2014-12-21T23:27:17Z" count="1"/>
        </bookmark:applications>
      </metadata>
    </info>
  </bookmark>
"

inkscape version : revno: 13821 from trunk
OS: debian sid

I cannot tell yet if the issue is to gtk side (if file:$HOME is invalid why accept it) or inkscape (should it discard invalid entries) or both .

Alban Browaeys (prahal) wrote :
su_v (suv-lp) wrote :

Likely the same issue as reported earlier in
- Bug #1394610 “Inkscape r13731 crashes on file”
- Bug #1388100 “Crash while opening any file”

tags: added: crash
Changed in inkscape:
importance: Undecided → High
jazzynico (jazzynico) on 2014-12-26
summary: - file:$HOME - erminate called after throwing an instance of
- 'Glib::ConvertError'
+ Crash when opening files (Glib::ConvertError exception)
jazzynico (jazzynico) wrote :

Reproduced on Crunchbang Waldorf, Inkscape 0.91.x branch rev. 13689, by adding the block from the original description to my recently-used.xbel file.
Not reproduced with 0.48.3.1.

Note that the issue also affects files opened with the command line and the File>Open menu, but not files imported with File>Import.

Changed in inkscape:
status: New → Triaged
tags: added: opening regression
jazzynico (jazzynico) wrote :

Quote from bug #1388100 (comment #1 by ~suv):
"Trunk has newer code with comments about throwing Glib::ConvertError, in src/resource-manager.cpp (in 'extractFilepath()'):
 http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/src/resource-manager.cpp#L148
AFAIU extractFilepath() is mainly used used when attempting to fix broken image links when loading documents, based on the current location of the file, and the recent file history."

xapantu (xapantu) wrote :

At line 161,
uri = Glib::filename_from_uri(href);

must be replaced by

 uri = Glib::filename_from_utf8(href);

(I attach the patch for 0.91 because I posted it on another bug, but it must be irrelevant now)

xapantu (xapantu) wrote :
Alban Browaeys (prahal) wrote :

I confirm that inkscape at latest revision now , that is 13821 , is still affected by this bug.
 And also that the patch from comment #6 also still apply and fix this issue.

su_v (suv-lp) wrote :

JFTR - quoting Jon Cruz's reply on irc from 2015-05-07 when asked for a quick review of the proposed patch:
«edge conditions on charset conversions are quite tricky (…) the _from_uri uses escaped ASCII and also might start with "file://" , etc. The _from_utf8 deals with neither of those. :-( »

The issue was also brought up on the mailing list (no further replies wrt possible fixes, unfortunately):
http://sourceforge.net/p/inkscape/mailman/message/34173721/

roland (wildhostile) on 2015-08-11
description: updated
roland (wildhostile) wrote :

Hi,

I had this bug too.
fedora 21 and 22 inkscape 0.91 r13725.

I don't know what manipulation led to it.

Deleting recently-used.xbel file did the trick.
However, as a gnome-shell user, I had to reboot and log into fedora in maintenance mode and remove the file from the command line (with rm), otherwise removing or modifying this file in graphical mode cannot be acheived.

thanks suv.

I had the same issue and deleting ~/.local/share/recently-used.xbel solved it.

I am attaching a patch (taken with bzr diff against trunk revno 14389) for this bug. It turns out that the exception is raised in function ResourceManagerImpl::locateLinks (in resource-manager.cpp) when a file in the "recently used" list has a format that is not accepted by filename_from_url().

 I added code to ResourceManagerImpl::locateLinks to catch the Glib::ConvertError exception raised by filename_from_url() in order to skip the offending entry and print a warning message.

I recreated the bug on my computer and it looks like the proposed change corrects it.

su_v (suv-lp) wrote :

Patch from Riccardo (comment #11) tested successfully (based on the few known examples of problematic entries in recently-used.xbel provided by affected users) with Inkscape 0.91+devel r14389 on OS X 10.7.5.

Changed in inkscape:
assignee: nobody → Riccardo Bernardini (framefritti)
milestone: none → 0.92
status: Triaged → In Progress
tags: added: backport-proposed
jazzynico (jazzynico) wrote :

Patch tested successfully on Xubuntu 15.04 and (for regressions) Windows XP (32bit), with Inkscape trunk rev. 14392.

jazzynico (jazzynico) wrote :

Fix committed in the trunk, rev. 14393.
Thanks Riccardo!

Changed in inkscape:
status: In Progress → Fix Committed
su_v (suv-lp) wrote :

Fix backported to 0.91.x in rev 13839.

Changed in inkscape:
milestone: 0.92 → 0.91.1
tags: removed: backport-proposed
jazzynico (jazzynico) on 2017-01-22
Changed in inkscape:
milestone: 0.91.1 → 0.92
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers