Undo crash when executing extensions

Bug #249035 reported by khiraly
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
Adonis Papaderos

Bug Description

Try any extensions on this specifiy .svg file, and after do an undo.
Inkscape crash with runtime error, and convince me, it has emergency saved the document
(alascape.exe.2008_07_16_14_41_56.0)

If I unlock and relock some layers in the layers dialog, and select an unlocked layer,
and after that I launch the extension, everything is fine.

Try for example Effects -> Modify Path -> Add nodes

Environment: inkscape 0.46, windows xp

Revision history for this message
khiraly (khiraly123) wrote :
Revision history for this message
sas (sas-sas) wrote :

Confirmed in SVN revision 19333. The following message appears on stderr:

** ERROR:(src/document-undo.cpp:173):void sp_document_maybe_done(SPDocument*, const gchar*, unsigned int, Glib::ustring): assertion failed: (doc->priv->sensitive)

Changed in inkscape:
status: New → Confirmed
Revision history for this message
khiraly (khiraly123) wrote :

> If I unlock and relock some layers in the layers dialog, and select an unlocked layer,
> and after that I launch the extension, everything is fine.

It is enough to select an unlocked layer, and after execute the extension.
(no need to lock/unlock layers)

tags: added: extensions-plugins
Revision history for this message
su_v (suv-lp) wrote :

Inkscape 0.46+devel r22293 on OS X 10.5.8

cannot reproduce this crash. Inkscape reacts slowly when undoing the 'Add nodes…' extension, but it undoes everything without crash and any related console error messages.

Proposing to close this bug as fixed.

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

@khiraly - can you test this with a recent prerelease or SVN version?

Revision history for this message
Chris Mohler (cr33dog) wrote :

I'm seeing a similar issue. To reproduce:

Write a simple extension that sets the current layer's style to "display:none". (see attachments)
Run the extension
Undo

Result:
ERROR:document-undo.cpp:173:void sp_document_maybe_done(SPDocument*, const gchar*, unsigned int, Glib::ustring): assertion failed: (doc->priv->sensitive)

Happens on 0.46 and current SVN.

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

> sets the current layer's style to "display:none".
doesn't do that on OS X: it always sets 'layer 1' to "display:none", not the current.

> Run the extension, Undo
No crash reproduced with Inkscape 0.46+devel r22436 on OS X 10.5.8
- using python26 @2.6.2, py26-lxml @2.2.2, py26-numpy @1.3.0
- extension 'undo_crash' installed into '~/.config/inkscape/extensions'
no related console messages either

Could this crash be win32 only?

(BTW - your 'inx' files will need a new XML and namespace declaration for Inkscape 0.47 - see the changes to *.inx in revision 18364 <http://inkscape.svn.sourceforge.net/viewvc/inkscape?view=rev&revision=18364>)

Revision history for this message
Chris Mohler (cr33dog) wrote :

Odd - I'm using linux, and it crashes every time. And you are correct - the test extension is setting the first layer's style to "display:none".

If I add a second line to the extension that then sets the style to "display:inline", then Undo does not crash.

I'm python 2.6 and lxml 2.1.5 here on linux.

OK - that extension and then an undo on win XP also crashes. Inkscape 0.46.

Thanks for the info on the namespace change.

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

> Thanks for the info on the namespace change.
There is an XML schema (Relax NG) for Inkscape extension files:
<http://inkscape.svn.sourceforge.net/viewvc/inkscape/inkscape/trunk/share/extensions/inkscape.extension.rng?view=markup>
and a discussion about it on inkscape-devel:
<http://thread.gmane.org/gmane.comp.graphics.inkscape.devel/26105>

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

Now I figured out how to reproduce the crash with 'undo_crash.py', both Inkscape 0.46-2 and Inkscape 0.46+devel r22436 on OS X 10.5.8 crash on undo after running the extension.

In previous test I had several layers and 'Layer 1' wasn't the current one. Inkscape only crashes when 'Layer 1' (i.e. the one your extension hides) is current, independent of the number of layers above or below.

Sorry for the delayed confirmation - I didn't make that connection when I noted that the extension was always hiding the first layer, not the current.

Revision history for this message
Chris Mohler (cr33dog) wrote :

OK - thanks. I have a strong suspicion that this is the same issue that the original submitter ran into, and now at least we have a reliable way to reproduce. So to recap:

1. Install extension
2. Start Inkscape (new file)
3. Run Effects->Debug->Undo Crash
4. Undo (either Edit->Undo or CTRL-Z)
5. Crash

I took a quick peek at document-undo.cpp, but have no idea why that assertion fails...

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

Attaching the backtrace from Inkscape 0.46-2 as well (slightly different than r22436, dunno if relevant for a current SVN bug fix)

su_v (suv-lp)
Changed in inkscape:
importance: Undecided → High
Revision history for this message
Alvin Penner (apenner) wrote :

- the code undo_crash.py will not run under lxml version 1.3beta, which is the current version.
- attached is a slightly modified version which will run under lxml 1.3beta. It borrows heavily from existing code in the extensions directory.
- with this code I can duplicate the above crash under Windows XP.
- the crash message is identical to comment 6 above

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

Crash reproduced with Inkscape 0.48+devel r10110 on OS X 10.5.8 (i386)
Crash no longer reproduced with Inkscape 0.48+devel r10112+patch from merge request

jazzynico (jazzynico)
Changed in inkscape:
assignee: nobody → Adonis Papaderos (ado-papas)
milestone: none → 0.49
status: Confirmed → In Progress
Revision history for this message
jazzynico (jazzynico) wrote :

Fix committed in the trunk, revision 10113.
Thanks Adonis!

Changed in inkscape:
status: In Progress → Fix Committed
tags: added: backport-proposed
Revision history for this message
jazzynico (jazzynico) wrote :

Patch committed in the 0.48.x branch, revision 9792.

Changed in inkscape:
milestone: 0.49 → 0.48.2
tags: removed: backport-proposed
Ted Gould (ted)
Changed in inkscape:
status: Fix Committed → 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.