Crash opening file with absurdly large path

Migrated from https://bugs.launchpad.net/inkscape/+bug/1474359

Steps to reproduce

  • Create file <svg xmlns="http://www.w3.org/2000/svg"><path d="m 0 0 v 1e309 -1e309 0" /></svg>
  • Open in Inkscape

Test file from launchpad (d="m 9. 45E+7 -3 -693 -4e-766 .3718e7 4,3425E0681,+98 -3.0e02643 -9. 9"))

original_sample.svg

What happened?

Crash

(org.inkscape.Inkscape:3119): glibmm-ERROR **: 03:09:42.835: 
unhandled exception (type std::exception) in signal handler:
what: lib2geom exception: Non-contiguous path (../src/3rdparty/2geom/src/2geom/path.cpp:1043)

Backtrace: inkscape-backtrace-crash-large.txt

We also crash if you create a path and replace the d attribute's value in the xml editor. That crashes with the shorter d="m 0 0 v 1e309". However, a path with that value won't crash on opening the file.

We still crash in shell (i.e. without GUI).

What should have happened?

No crash.

I guess we're going to end up with inkscape#1446

Version Info:

  • Inkscape 1.1-dev (aa764a7b88, 2020-06-18, custom) Linux Mint 19.1
  • Inkscape 0.92.5 (fe8e1c6569, 2020-04-22) Linux Mint 19.1
  • Inkscape r14243, Ubuntu 15.04, x86_64
  • Inkscape 0.48.5 r10040, OS X 10.7.5.
  • Inkscape 0.91 r13725, OS X 10.7.5.
  • Inkscape 0.91+devel r14245, OS X 10.7.5.
  • Inkscape r14285, Windows XP x32

Crash not related to the 2geom update in July 2015 (recent at time of report).

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information