Internal error when opening svg file with "nan" coordinates

Bug #1792352 reported by crep4ever on 2018-09-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
High
Mc

Bug Description

Inkscape cannot open the attached svg file.

Note that:
 - inkview fails as well (nothing is displayed).
 - when doing inkscape file > open, inkscape correctly displays the svg preview
 - dolphin (KDE) can preview the file
 - firefox has no problem with opening the file

Tested inkscape version: 0.92.2 and 0.92.3
Tested platforms: windows 10, ubuntu 18.10

crep4ever (romain-goffe) wrote :
Mc (mc...) wrote :

some circles have cx="nan" values

Alvin Penner (apenner) wrote :

crash confirmed on Windows 10, Inkscape 0.92.3 (2405546, 2018-03-11)

DOS output is :

terminate called after throwing an instance of 'Geom::Exception'
  what(): lib2geom exception: assertion failed: B.isFinite() (../src/2geom/sbasis-to-bezier.cpp:476)

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

Changed in inkscape:
status: New → Confirmed
Max Gaukler (mgmax) on 2018-09-13
Changed in inkscape:
milestone: none → 0.92.4
importance: Undecided → High
Max Gaukler (mgmax) wrote :

"nan" values alone don't seem to be the problem.
crep4ever: Can you try to minimize your crashing file? Just open it in a text editor and remove as many lines as possible, but make sure that inkscape still crashes when opening the file.

(Or does someone have a script for that?)

Max Gaukler (mgmax) wrote :

What I wrote before was wrong, nan is the problem, but only if it has a stroke, otherwise I can even edit it in the user interface! A minimal case is attached.

Note to future me: Automatically reducing a large crashing file / testcase can be automated by:

$ cat <<EOF > tester.sh
#!/bin/sh
set -e
mv $1 /tmp/bla.svg
# return true if inkscape crashed as we wanted, otherwise return false.
{ timeout 2 inkscape /tmp/bla.svg --verb=FileQuit 2>&1 || true; } | fgrep -q "assertion failed"
EOF
$ singledelta -test=tester.sh /tmp/Qmin_AgBe.svg
...
...
output is in tmp1/log
$ cat tmp1/log
...
057.c, lines: 6 98 sec/00:01:38 Thu Sep 13 21:15:51 2018
$ inkscape /tmp1/057.c # (pick number of last "success")
(crash)
# then manually simplify the resulting file

Max Gaukler (mgmax) wrote :

crep4ever: Inkscape should not crash, but nevertheless the SVG is not valid and you should report a bug with the original program that it must not output "nan" coordinate values.

summary: - Internal error when opening svg file
+ Internal error when opening svg file with "nan" coordinates
Changed in inkscape:
status: Confirmed → Triaged
Mc (mc...) wrote :
Changed in inkscape:
status: Triaged → Fix Committed
assignee: nobody → Mc (mc...)
Mc (mc...) on 2018-10-07
Changed in inkscape:
status: Fix Committed → In Progress
Mc (mc...) on 2018-10-07
Changed in inkscape:
status: In Progress → Fix Committed
Bryce Harrington (bryce) on 2019-01-18
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