Comment within <script> element in INX file triggers crash on launch (rev >= 13421)

Bug #1372200 reported by su_v on 2014-09-21
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Medium
jazzynico

Bug Description

Follow-up report to
- Bug #505920 “inkscape loads extension even if the script specified in <command> doesn't exist”
  https://bugs.launchpad.net/inkscape/+bug/505920

Any INX file with a comment within the <script></script> element triggers a crash on launch. Based on tests with archived builds on OS X 10.7.5, this regression was introduced in rev 13421 to fix bug #505920.

Notes:
- it does not matter whether the comment is empty or not
- it does not matter whether scripts referenced via <dependency> are found or not
- it does not matter whether the extension is installed into the shared or into the user's extensions directory.

Steps to reproduce:
1) download attached INX file
2) copy it into ~/.config/inkscape/extensions
3) try to launch inkscape as usual

Expected result:
Inkscape launches normally, the extension is not loaded since the dependent script is not installed.

Actual result:
Inkscape crashes during parsing of the INX file (AFAIU):

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x00000001003e78ca in Inkscape::Extension::Dependency::Dependency (this=0x10b903f50, in_repr=0x10bb1c2b0) at ../../src/extension/dependency.cpp:84
84 _string = _repr->firstChild()->content();

su_v (suv-lp) wrote :
su_v (suv-lp) wrote :

Backtrace (debug build r13562, OS X 10.7.5)

(Note wrt paths seen in backtrace: for the backtrace Inkscape was launched via shell script which sets custom paths for XDG user locations: e.g. $XDG_CONFIG_HOME is "$HOME/TEMP/inkmini-quartz".)

For completeness' sake, attaching a working version of the INX file, and
the python script file referenced by both INX files.

jazzynico (jazzynico) wrote :

Thanks for the follow-up (I almost forgot the regression...).

Changed in inkscape:
assignee: nobody → jazzynico (jazzynico)
status: New → Triaged
jazzynico (jazzynico) on 2014-09-22
Changed in inkscape:
status: Triaged → In Progress
jazzynico (jazzynico) wrote :

Patch attached.
We now check (and skip) lines with comments and other non-element nodes.
Tested on Windows XP, Inkscape trunk revision 13562.

jazzynico (jazzynico) wrote :

Also tested on Crunchbang Waldorf, and committed revision 13563.

Changed in inkscape:
status: In Progress → Fix Committed
jazzynico (jazzynico) on 2015-02-14
Changed in inkscape:
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