With JessyInk installed in an .svg file, opening the document properties dialog causes a crash

Bug #383244 reported by Thomas Ibbotson
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
Hannes Hochreiner
JessyInk
Fix Released
High
Hannes Hochreiner

Bug Description

On win32 with inkscape devel rev:21470 inkscape crashes when JessyInk has been installed in an .svg file when trying to open the document properties dialog.

Reproduction steps:
-Run inkscape
-Install JessyInk i.e. Extensions->JessyInk->install/update...
-Ctrl-Shift-D (or use the menu to open the document properties dialog)
Inkscape then crashes.

Tried to get a backtrace using gdb, but inkscape hung on install/update when run in gdb.

Tags: crash
Revision history for this message
Hannes Hochreiner (hannes-hochreiner) wrote :

Currently, I can't test on Windows, but if someone finds the cause of the crash, I am more than happy to make all the changes required for JessyInk to work properly with Inkscape. I set the importance to medium, since the problem was reported with a development version.

Changed in jessyink:
importance: Undecided → Medium
Revision history for this message
Hannes Hochreiner (hannes-hochreiner) wrote :

Reproduced the problem today with inkscape-0.47pre1 on Ubuntu 9.04.

Changed in jessyink:
importance: Medium → High
status: New → Triaged
Revision history for this message
Hannes Hochreiner (hannes-hochreiner) wrote :

The problem also affects the new extensions in the web->javascript sub-menu. The issue seems to be that the function collecting the information about external scripts does not properly handle scripts incorporated into the svg document (i.e. all script nodes are expected to have a xlink:href attribute. If there is none, Inkscape crashes). To fix the issue, it should be enough to add a simple if condition in "populate_external_scripts_box" function in "ui/dialog/document-properties.cpp" (line 675). In a quick try it seemed to work, but I wanted to do some more testing before publishing a patch.

Revision history for this message
jazzynico (jazzynico) wrote :

Confirmed on Vista, Inkscape rev. 21852.
Not tested with JessyInk, but Javascript extensions lead to the same crash (and same gdb trace).

Changed in inkscape:
importance: Undecided → High
status: New → Confirmed
tags: added: crash
Revision history for this message
Hannes Hochreiner (hannes-hochreiner) wrote :

Attached to this comment you can find a patch that solved the problem for me. Essentially, it ignores all the script nodes not having an xlink attribute. I also changed the way the identity of the script nodes is checked when they are deleted. The reason being that in my tests Inkscape crashed when I tried to delete an external script node that had an xlink attribute that was a substring of another xlink attribute (e.g. one xlink attribute being "test" and one "test1", try to delete "test" => crash).

Changed in jessyink:
assignee: nobody → Hannes Hochreiner (hannes-hochreiner)
status: Triaged → Fix Committed
Revision history for this message
jazzynico (jazzynico) wrote :

Fix committed in Inkscape rev. 21932.
Thanks Hannes!

Changed in inkscape:
assignee: nobody → Hannes Hochreiner (hannes-hochreiner)
milestone: none → 0.47
status: Confirmed → Fix Committed
ScislaC (scislac)
Changed in inkscape:
status: Fix Committed → Fix Released
Changed in jessyink:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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