Crash when opening file with live path effect

Bug #1769679 reported by Yeti
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Undecided
Jabiertxof

Bug Description

Version: Inkscape 0.92.2 2405546, 2018-03-11

(compiled from inkscape-0.92.3.tar.bz2, not sure why it says 0.92)

OS: Fedora 27/x86_64

Running

    inkscape crashme.svg

or

    inkview crashme.svg

with the attached SVG file results in a crash:

** (inkscape:2586): CRITICAL **: SPNamedView* sp_document_namedview(SPDocument*, const gchar*): assertion 'document != NULL' failed

Emergency save activated!
Emergency save completed. Inkscape will close now.
If you can reproduce this crash, please file a bug at www.inkscape.org
with a detailed description of the steps leading to the crash, so we can fix it.

** (inkscape:2586): CRITICAL **: SPNamedView* sp_document_namedview(SPDocument*, const gchar*): assertion 'document != NULL' failed
Segmentation fault (core dumped)

The culprit seems live path effects.

The problem appeared after upgrading from inkscape 0.92.2, which does not crash.

Revision history for this message
Yeti (yeti) wrote :
Revision history for this message
Yeti (yeti) wrote :

Attaching also backtrace from the crash...

Jabiertxof (jabiertxof)
Changed in inkscape:
assignee: nobody → Jabiertxof (jabiertxof)
Revision history for this message
Jabiertxof (jabiertxof) wrote :

Hi Yeti. Thanks for fill report.

I think the problem is your file miss ViewBox. I try later prevent the crash. but the LPE dont work correctly without it.

Revision history for this message
Yeti (yeti) wrote :

Indeed, I originally encountered this with files that are quite old. But the example attached to the report was loaded to 0.92.2, edited (I removed a bunch of elements unrelated to the crash) and saved from this version. So even considering something was amiss in SVGs created in old versions, I do not understand what the proper ‘upgrade’ path is. Version 0.92.2 opens the file fine, including visual appearance (AFAICT), and still saves something 0.92.3 crashes upon opening.

Revision history for this message
Yeti (yeti) wrote :

So the upgrade path seems to be opening the SVG in vim, deleting the live path effects definitions and references there, opening the file in Inkscape 0.92.3 (it then no longer crashes) and either keeping the path effects dead or recreating them from scratch. Is anything better possible?

Revision history for this message
Alvin Penner (apenner) wrote :

with respect to comment 3, I am not convinced that the lack of a viewbox is the source of the problem. Attached is an edited version of this file, in which I have manually added a viewbox. I did this by opening the file, opening Document Properties, and toggling the Scale from 1.0 to 1.1 and then back to 1.0 again. This forces a viewbox to be created.

The edited version is attached and still crashes as before.

I should say it crashes only in some cases:
- it crashes if I run it from CLI using a command like 'inkscape crashme.svg'
- it crashes if I do a right click on the file in Windows EXplorer
- it crashes if I run it from gdb
- it does _not_ crash if I first open Inkscape, and then load the file using File->Open

Changed in inkscape:
status: New → Confirmed
Revision history for this message
Alvin Penner (apenner) wrote :

attached is another example of a file that crashes. This file was created using Inkscape 0.92.3, and has a viewbox.

running this on Windows 10, Inkscape 0.92.3 (cdafc07, 2018-06-25), from DOS, I get the message:

C:\APP\Temp\inkscape_0.92.x>inkscape \windows\temp\myruler.svg

** (inkscape.exe:6952): CRITICAL **: 05:19:35.008: SPNamedView* sp_document_namedview(SPDocument*, const gchar*): assertion 'document != NULL' failed

Revision history for this message
Alvin Penner (apenner) wrote :

backtrace:
Program received signal SIGSEGV, Segmentation fault.
0x01353126 in libinkscape_base!_ZN8Inkscape14LivePathEffect8LPERuler13doEffect_pwd2ERKN4Geom9PiecewiseINS2_2D2INS2_6SBasisEEEEE
    () from c:\app\temp\inkscape_0.92.x\libinkscape_base.dll
(gdb) bt
#0 0x01353126 in libinkscape_base!_ZN8Inkscape14LivePathEffect8LPERuler13doEffect_pwd2ERKN4Geom9PiecewiseINS2_2D2INS2_6SBasisEEEEE () from c:\app\temp\inkscape_0.92.x\libinkscape_base.dll
#1 0x012e87ff in libinkscape_base!_ZN8Inkscape14LivePathEffect6Effect13doEffect_pathERKN4Geom10PathVectorE ()
   from c:\app\temp\inkscape_0.92.x\libinkscape_base.dll
#2 0x012e8176 in libinkscape_base!_ZN8Inkscape14LivePathEffect6Effect8doEffectEP7SPCurve ()
   from c:\app\temp\inkscape_0.92.x\libinkscape_base.dll
#3 0x0184639d in libinkscape_base!_ZN9SPLPEItem17performPathEffectEP7SPCurveb ()
   from c:\app\temp\inkscape_0.92.x\libinkscape_base.dll
#4 0x018694fc in libinkscape_base!_ZN6SPPath17update_patheffectEb () from c:\app\temp\inkscape_0.92.x\libinkscape_base.dll
#5 0x0184468f in libinkscape_base!_Z29sp_lpe_item_update_patheffectP9SPLPEItembb ()
   from c:\app\temp\inkscape_0.92.x\libinkscape_base.dll
#6 0x0066f9d8 in ?? ()
#7 0xbaadf00c in ?? ()
#8 0x00000000 in ?? ()
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x01353126 in libinkscape_base!_ZN8Inkscape14LivePathEffect8LPERuler13doEffect_pwd2ERKN4Geom9PiecewiseINS2_2D2INS2_6SBasisEEEEE
    () from c:\app\temp\inkscape_0.92.x\libinkscape_base.dll
(gdb) c
Continuing.
[Inferior 1 (process 4664) exited with code 030000000005]

Revision history for this message
Jabiertxof (jabiertxof) wrote :

Fixed on 6f6fef7fb

Changed in inkscape:
status: Confirmed → Fix Committed
Revision history for this message
Alvin Penner (apenner) wrote :

testing on Windows 10, Inkscape 0.92+devel (e939fcc, 2018-09-29)

when I open the file using: inkscape \windows\temp\myruler.svg
I still get the crash:
** (inkscape.exe:3728): CRITICAL **: 18:52:32.938: SPNamedView* sp_document_namedview(SPDocument*, const gchar*): assertion 'document != nullptr' failed

Revision history for this message
Alvin Penner (apenner) wrote :

the crash appears to depend on how the file is opened. if I open it from the gui there is no problem. if I open it from the command line I get a crash.

Revision history for this message
Jabiertxof (jabiertxof) wrote :

Thanks Alvin for testing, I only fix 0.92.x. in new 03cdb70a is fixed for master

Revision history for this message
Alvin Penner (apenner) wrote :

thanks Jabiertxof, I just tested with Inkscape 0.92+devel (0ab3449, 2018-09-30)

- the crash is fixed, but I get the following warning messages:

C:\APP\Temp\inkscape_devel>inkscape \windows\temp\myruler.svg
Pango version: 1.42.3

** (inkscape.exe:10968): CRITICAL **: 17:16:51.846: SPNamedView* sp_document_namedview(SPDocument*, const gchar*): assertion 'document != nullptr' failed

** (inkscape.exe:10968): CRITICAL **: 17:16:51.846: SPNamedView* sp_document_namedview(SPDocument*, const gchar*): assertion 'document != nullptr' failed

** (inkscape.exe:10968): CRITICAL **: 17:16:51.846: SPNamedView* sp_document_namedview(SPDocument*, const gchar*): assertion 'document != nullptr' failed

** (inkscape.exe:10968): CRITICAL **: 17:16:51.846: SPNamedView* sp_document_namedview(SPDocument*, const gchar*): assertion 'document != nullptr' failed

** (inkscape.exe:10968): CRITICAL **: 17:16:51.846: SPNamedView* sp_document_namedview(SPDocument*, const gchar*): assertion 'document != nullptr' failed

** (inkscape.exe:10968): CRITICAL **: 17:16:51.846: SPNamedView* sp_document_namedview(SPDocument*, const gchar*): assertion 'document != nullptr' failed

** (inkscape.exe:10968): CRITICAL **: 17:16:51.846: SPNamedView* sp_document_namedview(SPDocument*, const gchar*): assertion 'document != nullptr' failed

Revision history for this message
Jabiertxof (jabiertxof) wrote :

Hi Alvin!
This hapends because file dont have namedview. No way to remove this warnings.

Revision history for this message
Alvin Penner (apenner) wrote :

but the file myruler.svg does have a namedview, and it has a viewbox.

- just for testing purposes, I have created a new file called 'myruler_10_1.svg', created today using:
Inkscape 0.92+devel (0ab3449, 2018-09-30)
- it has a namedview and a viewbox and generates the following warnings:

this seems to happen only for the ruler LPE, if I use 'Bend' it does not happen.

………………………………………….
C:\APP\Temp\inkscape_devel>inkscape \windows\temp\myruler_10_1.svg
Pango version: 1.42.3

** (inkscape.exe:1164): CRITICAL **: 15:08:12.353: SPNamedView* sp_document_namedview(SPDocument*, const gchar*): assertion 'document != nullptr' failed

** (inkscape.exe:1164): CRITICAL **: 15:08:12.353: SPNamedView* sp_document_namedview(SPDocument*, const gchar*): assertion 'document != nullptr' failed

** (inkscape.exe:1164): CRITICAL **: 15:08:12.369: SPNamedView* sp_document_namedview(SPDocument*, const gchar*): assertion 'document != nullptr' failed

** (inkscape.exe:1164): CRITICAL **: 15:08:12.369: SPNamedView* sp_document_namedview(SPDocument*, const gchar*): assertion 'document != nullptr' failed

** (inkscape.exe:1164): CRITICAL **: 15:08:12.369: SPNamedView* sp_document_namedview(SPDocument*, const gchar*): assertion 'document != nullptr' failed

** (inkscape.exe:1164): CRITICAL **: 15:08:12.369: SPNamedView* sp_document_namedview(SPDocument*, const gchar*): assertion 'document != nullptr' failed

** (inkscape.exe:1164): CRITICAL **: 15:08:12.369: SPNamedView* sp_document_namedview(SPDocument*, const gchar*): assertion 'document != nullptr' failed

** (inkscape.exe:1164): CRITICAL **: 15:08:12.369: SPNamedView* sp_document_namedview(SPDocument*, const gchar*): assertion 'document != nullptr' failed

Revision history for this message
Alvin Penner (apenner) wrote :

forgot this:

Revision history for this message
Jabiertxof (jabiertxof) wrote :

fixed on master on e4ee2f0c soon in 0.92.x. Thanks Alvin for testing!

Revision history for this message
Jabiertxof (jabiertxof) wrote :

On a1973b44 I also fix a bug to correct update the LPE on launch from comand line.

Revision history for this message
Jabiertxof (jabiertxof) wrote :

On 0.92.x fixed on 0bcb9efb

Revision history for this message
Alvin Penner (apenner) wrote :

tested Inkscape 0.92+devel (33cd18d, 2018-10-02)

looks good to me, thanks Jabiertxof!

Revision history for this message
Jabiertxof (jabiertxof) wrote :

Thanks to you for testing!

Revision history for this message
Qantas94Heavy (qantas94heavy) wrote :

Commit released in 0.92.4, closing as fixed :)

Closed by: https://gitlab.com/Qantas94Heavy

Changed in inkscape:
milestone: none → 0.92.4
status: Fix Committed → Fix Released
tbnorth (terry-n-brown)
tags: added: bug-migration
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.