Snap to path intersection freezes up Inkscape

Summary:

Inkscape effectively freezes up trying to find path intersection for snapping

Steps to reproduce:

  • open Inkscape
  • turn on snapping to nodes (in simple mode) or "snap to nodes"/"path intersection" (in advanced mode)
  • enable snapping
  • open test file (attached)
  • try to draw rectangle starting in a lower left corner of the canvas

What happened?

  • Inkscape stops responding

What should have happened?

  • I should be able to draw rectangle

Sample attachments:

Fattern_Outlines_individual.svg

Version info

Inkscape 1.2-dev (e9ad4d4276, 2022-02-01)

    GLib version:     2.70.2
    GTK version:      3.24.30
    glibmm version:   2.66.2
    gtkmm version:    3.24.5
    libxml2 version:  2.9.4
    libxslt version:  1.1.34
    Cairo version:    1.16.0
    Pango version:    1.50.3
    HarfBuzz version: 3.2.0

    OS version:       macOS

Profiler output pointing to getClosestIntersectionCS(), which is path intersection snapping:

  41 libinkscape_base.dylib 373839.0  Inkscape::UI::Tools::sp_event_context_snap_watchdog_callback(void*) /Users/mike/dev/inkscape/src/ui/tools/tool-base.cpp:1514
  40 libinkscape_base.dylib 373839.0  Inkscape::UI::Tools::sp_event_context_virtual_root_handler(Inkscape::UI::Tools::ToolBase*, _GdkEvent*) /Users/mike/dev/inkscape/src/ui/tools/tool-base.cpp:1156
  39 libinkscape_base.dylib 373831.0  Inkscape::UI::Tools::RectTool::root_handler(_GdkEvent*) /Users/mike/dev/inkscape/src/ui/tools/rect-tool.cpp:223
  38 libinkscape_base.dylib 373831.0  SnapManager::preSnap(Inkscape::SnapCandidatePoint const&, bool) /Users/mike/dev/inkscape/src/snap.cpp:173
  37 libinkscape_base.dylib 373831.0  SnapManager::freeSnap(Inkscape::SnapCandidatePoint const&, Geom::OptRect const&, bool) const /Users/mike/dev/inkscape/src/snap.cpp:164
  36 libinkscape_base.dylib 373586.0  SnapManager::findBestSnap(Inkscape::SnapCandidatePoint const&, IntermSnapResults const&, bool, bool, bool) const /Users/mike/dev/inkscape/src/snap.cpp:583
  35 libinkscape_base.dylib 373586.0  getClosestIntersectionCS(std::__1::list<Inkscape::SnappedCurve, std::__1::allocator<Inkscape::SnappedCurve> > const&, Geom::Point const&, Inkscape::SnappedPoint&, Geom::Affine) /Users/mike/dev/inkscape/src/snapped-curve.cpp:195
  34 libinkscape_base.dylib 373522.0  Inkscape::SnappedCurve::intersect(Inkscape::SnappedCurve const&, Geom::Point const&, Geom::Affine) const /Users/mike/dev/inkscape/src/snapped-curve.cpp:67
  33 libinkscape_base.dylib 373406.0  Geom::crossings(Geom::Curve const&, Geom::Curve const&) /Users/mike/dev/inkscape/src/3rdparty/2geom/include/2geom/path-intersection.h:92
  32 lib2geom.1.1.0.dylib 373387.0  Geom::SimpleCrosser::crossings(Geom::Curve const&, Geom::Curve const&) /Users/mike/dev/inkscape/src/3rdparty/2geom/src/2geom/path-intersection.cpp:295
  31 lib2geom.1.1.0.dylib 373317.0  Geom::pair_intersect(Geom::Curve const&, double, double, Geom::Curve const&, double, double, std::__1::vector<Geom::Crossing, std::__1::allocator<Geom::Crossing> >&, unsigned int) /Users/mike/dev/inkscape/src/3rdparty/2geom/src/2geom/path-intersection.cpp:252
  30 lib2geom.1.1.0.dylib 373039.0  Geom::pair_intersect(Geom::Curve const&, double, double, Geom::Curve const&, double, double, std::__1::vector<Geom::Crossing, std::__1::allocator<Geom::Crossing> >&, unsigned int) /Users/mike/dev/inkscape/src/3rdparty/2geom/src/2geom/path-intersection.cpp:252
  29 lib2geom.1.1.0.dylib 372613.0  Geom::pair_intersect(Geom::Curve const&, double, double, Geom::Curve const&, double, double, std::__1::vector<Geom::Crossing, std::__1::allocator<Geom::Crossing> >&, unsigned int) /Users/mike/dev/inkscape/src/3rdparty/2geom/src/2geom/path-intersection.cpp:252
  28 lib2geom.1.1.0.dylib 371323.0  Geom::pair_intersect(Geom::Curve const&, double, double, Geom::Curve const&, double, double, std::__1::vector<Geom::Crossing, std::__1::allocator<Geom::Crossing> >&, unsigned int) /Users/mike/dev/inkscape/src/3rdparty/2geom/src/2geom/path-intersection.cpp:252
  27 lib2geom.1.1.0.dylib 368833.0  Geom::pair_intersect(Geom::Curve const&, double, double, Geom::Curve const&, double, double, std::__1::vector<Geom::Crossing, std::__1::allocator<Geom::Crossing> >&, unsigned int) /Users/mike/dev/inkscape/src/3rdparty/2geom/src/2geom/path-intersection.cpp:252
  26 lib2geom.1.1.0.dylib 364774.0  Geom::pair_intersect(Geom::Curve const&, double, double, Geom::Curve const&, double, double, std::__1::vector<Geom::Crossing, std::__1::allocator<Geom::Crossing> >&, unsigned int) /Users/mike/dev/inkscape/src/3rdparty/2geom/src/2geom/path-intersection.cpp:252
  25 lib2geom.1.1.0.dylib 358696.0  Geom::pair_intersect(Geom::Curve const&, double, double, Geom::Curve const&, double, double, std::__1::vector<Geom::Crossing, std::__1::allocator<Geom::Crossing> >&, unsigned int) /Users/mike/dev/inkscape/src/3rdparty/2geom/src/2geom/path-intersection.cpp:252
  24 lib2geom.1.1.0.dylib 349451.0  Geom::pair_intersect(Geom::Curve const&, double, double, Geom::Curve const&, double, double, std::__1::vector<Geom::Crossing, std::__1::allocator<Geom::Crossing> >&, unsigned int) /Users/mike/dev/inkscape/src/3rdparty/2geom/src/2geom/path-intersection.cpp:252
  23 lib2geom.1.1.0.dylib 336631.0  Geom::pair_intersect(Geom::Curve const&, double, double, Geom::Curve const&, double, double, std::__1::vector<Geom::Crossing, std::__1::allocator<Geom::Crossing> >&, unsigned int) /Users/mike/dev/inkscape/src/3rdparty/2geom/src/2geom/path-intersection.cpp:252
  22 lib2geom.1.1.0.dylib 318338.0  Geom::pair_intersect(Geom::Curve const&, double, double, Geom::Curve const&, double, double, std::__1::vector<Geom::Crossing, std::__1::allocator<Geom::Crossing> >&, unsigned int) /Users/mike/dev/inkscape/src/3rdparty/2geom/src/2geom/path-intersection.cpp:252
  21 lib2geom.1.1.0.dylib 291549.0  Geom::pair_intersect(Geom::Curve const&, double, double, Geom::Curve const&, double, double, std::__1::vector<Geom::Crossing, std::__1::allocator<Geom::Crossing> >&, unsigned int) /Users/mike/dev/inkscape/src/3rdparty/2geom/src/2geom/path-intersection.cpp:252
  20 lib2geom.1.1.0.dylib 252852.0  Geom::pair_intersect(Geom::Curve const&, double, double, Geom::Curve const&, double, double, std::__1::vector<Geom::Crossing, std::__1::allocator<Geom::Crossing> >&, unsigned int) /Users/mike/dev/inkscape/src/3rdparty/2geom/src/2geom/path-intersection.cpp:252
  19 lib2geom.1.1.0.dylib 198156.0  Geom::pair_intersect(Geom::Curve const&, double, double, Geom::Curve const&, double, double, std::__1::vector<Geom::Crossing, std::__1::allocator<Geom::Crossing> >&, unsigned int) /Users/mike/dev/inkscape/src/3rdparty/2geom/src/2geom/path-intersection.cpp:252
  18 lib2geom.1.1.0.dylib 119363.0  Geom::pair_intersect(Geom::Curve const&, double, double, Geom::Curve const&, double, double, std::__1::vector<Geom::Crossing, std::__1::allocator<Geom::Crossing> >&, unsigned int) /Users/mike/dev/inkscape/src/3rdparty/2geom/src/2geom/path-intersection.cpp:252
  17 lib2geom.1.1.0.dylib 56432.0  Geom::Curve::boundsLocal(Geom::OptInterval const&) const [inlined] /Users/mike/dev/inkscape/src/3rdparty/2geom/include/2geom/curve.h:174
  16 libinkscape_base.dylib 54913.0  Geom::BezierCurve::boundsLocal(Geom::OptInterval const&, unsigned int) const /Users/mike/dev/inkscape/src/3rdparty/2geom/include/2geom/bezier-curve.h:116
  15 libinkscape_base.dylib 54342.0  Geom::OptRect Geom::bounds_local<Geom::Bezier>(Geom::D2<Geom::Bezier> const&, Geom::OptInterval const&) /Users/mike/dev/inkscape/src/3rdparty/2geom/include/2geom/d2.h:482
  14 lib2geom.1.1.0.dylib 45677.0  Geom::bounds_local(Geom::Bezier const&, Geom::OptInterval const&) /Users/mike/dev/inkscape/src/3rdparty/2geom/src/2geom/bezier.cpp:307
  13 lib2geom.1.1.0.dylib 22146.0  Geom::portion(Geom::Bezier const&, double, double) /Users/mike/dev/inkscape/src/3rdparty/2geom/src/2geom/bezier.cpp:247
  12 lib2geom.1.1.0.dylib 21704.0  Geom::Bezier::Bezier(Geom::Bezier const&) [inlined] /Users/mike/dev/inkscape/src/3rdparty/2geom/include/2geom/bezier.h:151
  11 lib2geom.1.1.0.dylib 21704.0  Geom::Bezier::Bezier(Geom::Bezier const&) [inlined] /Users/mike/dev/inkscape/src/3rdparty/2geom/include/2geom/bezier.h:151
  10 lib2geom.1.1.0.dylib 21704.0  std::__1::valarray<double>::valarray(std::__1::valarray<double> const&) [inlined] /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/valarray:2827
   9 lib2geom.1.1.0.dylib 21704.0  std::__1::valarray<double>::valarray(std::__1::valarray<double> const&) [inlined] /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/valarray:2830
   8 lib2geom.1.1.0.dylib 20868.0  std::__1::allocator<double>::allocate(unsigned long) [inlined] /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:870
   7 lib2geom.1.1.0.dylib 20868.0  std::__1::__libcpp_allocate(unsigned long, unsigned long) [inlined] /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/new:261
   6 lib2geom.1.1.0.dylib 20868.0  void* std::__1::__libcpp_operator_new<unsigned long>(unsigned long) [inlined] /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/new:235
   5 libclang_rt.asan_osx_dynamic.dylib 20753.0  wrap__Znwm
   4 libclang_rt.asan_osx_dynamic.dylib 12868.0  __asan::asan_memalign(unsigned long, unsigned long, __sanitizer::BufferedStackTrace*, __asan::AllocType)
   3 libclang_rt.asan_osx_dynamic.dylib 12342.0  __asan::Allocator::Allocate(unsigned long, unsigned long, __sanitizer::BufferedStackTrace*, __asan::AllocType, bool)
   2 libclang_rt.asan_osx_dynamic.dylib 6386.0  __sanitizer::StackDepotPut(__sanitizer::StackTrace)
   1 libclang_rt.asan_osx_dynamic.dylib 5973.0  __sanitizer::StackDepotPut(__sanitizer::StackTrace)
   0 libclang_rt.asan_osx_dynamic.dylib 5973.0  __sanitizer::StackDepotBase<__sanitizer::StackDepotNode, 1, 20>::Put(__sanitizer::StackTrace, bool*)