0.92.x crash on moving group that has a connectors
Migrated from: https://bugs.launchpad.net/inkscape/+bug/1675779
Steps to reproduce:
- open Inkscape
- open test_bug.svg
- Use Shift+Arrow to move the group with the text "PMF" to the right (once out the document move down)
- This or similar random walks eventually leads to a crash.
What happened
Although this is has not been replicated in 1.0alpha (which has updated the adaptagrams (3rd party) code), it may simply be hidden in this test case.
Thus, this may be a) an upstream error, and b) already fixed
In 0.92.x code, it breaks because pos_to_angle
because the coords of centerPoint
are ±inf. They are assigned in vertexSweep(VertInf*)
.
VertInf passed to vertexSweep (note point
)
$4 = {_router = 0x555558da9460, id = {objID = 5248, isShape = true, vn = 0,
static src = 1, static tar = 2}, point = {x = inf, y = -inf, id = 5248,
vn = 0}, lstPrev = 0x555558e50160, lstNext = 0x555558d13090,
shPrev = 0x555558d98740, shNext = 0x555558d13090,
visList = empty std::__cxx11::listPython Exception <class 'ValueError'> Cannot find type Avoid::EdgeInfList::_Node:
, visListSize = 0,
orthogVisList = empty std::__cxx11::listPython Exception <class 'ValueError'> Cannot find type Avoid::EdgeInfList::_Node:
, orthogVisListSize = 0,
invisList = empty std::__cxx11::listPython Exception <class 'ValueError'> Cannot find type Avoid::EdgeInfList::_Node:
, invisListSize = 0, pathNext = 0x0,
visDirections = 0}
From a call to Router::processTransaction
, where shapeVisSweep
is called.
if (_polyLineRouting)
{
// o Check all visibility edges to see if this one shape
// blocks them.
if (!isMove || notPartialTime)
{
newBlockingShape(shapePoly, pid);
}
// o Calculate visibility for the new vertices.
if (UseLeesAlgorithm)
{
shapeVisSweep(shape);
}
else
{
shapeVis(shape);
}
}
The reason why I think that 1.0alpha may not be fixed is that shapeVisSweep is not called when using the test case (but is constantly called in 0.92.x). Maybe the problem was that it was called, I don't know.
Edit: also in 0.92.x, the shape passed to shapeVisSweep
usually has 4 points that correspond to the corners of the rhombus on the canvas in px. When the crash occurs, the left-most/first point was inf or nan (I forget which, invalid anyhow)
Backtrace
Backtrace from 0.92.1 r
[Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". [New Thread 0x7fffe9d03700 (LWP 16704)] [New Thread 0x7fffe9502700 (LWP 16705)] [New Thread 0x7fffe8d01700 (LWP 16706)] [New Thread 0x7fffe6c98700 (LWP 16707)] [New Thread 0x7fffe6497700 (LWP 16708)] [New Thread 0x7fffe5074700 (LWP 16712)] [Thread 0x7fffe5074700 (LWP 16712) exited] inkscape: libavoid/visibility.cpp :231 : static double Avoid::PointPair::pos_to_angle(double, double): l'assertion « ang >= 0 » a échoué.Thread 1 "inkscape" received signal SIGABRT, Aborted. 0x00007ffff0796a10 in raise () from /usr/lib/libc.so.6
(gdb) bt #0 0x00007ffff0796a10 in raise () at /usr/lib/libc.so.6 #1 0x00007ffff079813a in abort () at /usr/lib/libc.so.6 #2 0x00007ffff078f607 in __assert_fail_base () at /usr/lib/libc.so.6 #3 0x00007ffff078f6b2 in () at /usr/lib/libc.so.6 #4 0x0000000000e1a002 in Avoid::vertexSweep(Avoid::VertInf*) () #5 0x0000000000e1a190 in Avoid::shapeVisSweep(Avoid::ShapeRef*) () #6 0x0000000000e1155e in Avoid::Router::processTransaction() () #7 0x00000000006ea1bc in SPDocument::ensureUpToDate() () #8 0x00000000006f9ece in Inkscape::DocumentUndo::maybeDone(SPDocument*, char const*, unsigned int, Glib::ustring const&) () #9 0x0000000000760707 in sp_selection_move(Inkscape::Selection*, double, double) () #10 0x0000000000d3671e in Inkscape::UI::Tools::SelectTool::root_handler(_GdkEvent*) () #11 0x0000000000d49aea in Inkscape::UI::Tools::sp_event_context_virtual_root_handler(Inkscape::UI::Tools::ToolBase*, _GdkEvent*) () #12 0x0000000000970001 in sp_marshal_INT__POINTER_POINTER () #13 0x00007ffff1c27f75 in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0 #14 0x00007ffff1c39f82 in () at /usr/lib/libgobject-2.0.so.0 #15 0x00007ffff1c4266f in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0 #16 0x00007ffff1c42faf in g_signal_emit () at /usr/lib/libgobject-2.0.so.0 #17 0x000000000084b283 in () #18 0x000000000084bb63 in () #19 0x000000000096fdec in sp_marshal_BOOLEAN__POINTER () #20 0x00007ffff1c27f75 in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0 #21 0x00007ffff1c3a37d in () at /usr/lib/libgobject-2.0.so.0 #22 0x00007ffff1c4266f in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0 #23 0x00007ffff1c42faf in g_signal_emit () at /usr/lib/libgobject-2.0.so.0 #24 0x000000000089edfc in SPCanvas::emitEvent(_GdkEvent*) () #25 0x00007ffff4ddc7ac in () at /usr/lib/libgtk-x11-2.0.so.0 #26 0x00007ffff1c27ecf in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0 #27 0x00007ffff1c3a37d in () at /usr/lib/libgobject-2.0.so.0 #28 0x00007ffff1c4266f in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0 #29 0x00007ffff1c42faf in g_signal_emit () at /usr/lib/libgobject-2.0.so.0 #30 0x00007ffff4ef48cc in () at /usr/lib/libgtk-x11-2.0.so.0 #31 0x00007ffff4f082ff in gtk_window_propagate_key_event () at /usr/lib/libgtk-x11-2.0.so.0 #32 0x00007ffff4f0adcb in () at /usr/lib/libgtk-x11-2.0.so.0 #33 0x00007ffff4ddc7ac in () at /usr/lib/libgtk-x11-2.0.so.0 #34 0x00007ffff1c27f75 in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0 #35 0x00007ffff1c3a37d in () at /usr/lib/libgobject-2.0.so.0 #36 0x00007ffff1c4266f in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0 #37 0x00007ffff1c42faf in g_signal_emit () at /usr/lib/libgobject-2.0.so.0 #38 0x00007ffff4ef48cc in () at /usr/lib/libgtk-x11-2.0.so.0 #39 0x00007ffff4ddb04f in gtk_propagate_event () at /usr/lib/libgtk-x11-2.0.so.0 #40 0x00007ffff4ddb32b in gtk_main_do_event () at /usr/lib/libgtk-x11-2.0.so.0 #41 0x00007ffff4a5246c in () at /usr/lib/libgdk-x11-2.0.so.0 #42 0x00007ffff194f5a7 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0 #43 0x00007ffff194f810 in () at /usr/lib/libglib-2.0.so.0 #44 0x00007ffff194fb32 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0 #45 0x00007ffff4dda3a7 in gtk_main () at /usr/lib/libgtk-x11-2.0.so.0 #46 0x00000000006b240a in sp_main_gui(int, char const**) () #47 0x00007ffff0783511 in __libc_start_main () at /usr/lib/libc.so.6 #48 0x00000000006ae65a in _start ()
Backtrace from 0.92.4, with breakpoint at vertexSweep (just before the crash)
#0 0x00007ffff7175da7 in Avoid::vertexSweep(Avoid::VertInf*) (vert=0x555558c88f40) at ../src/libavoid/visibility.cpp:482 #1 0x00007ffff71757ca in Avoid::shapeVisSweep(Avoid::ShapeRef*) (shape=0x555558bed210) at ../src/libavoid/visibility.cpp:117 #2 0x00007ffff716691f in Avoid::Router::processTransaction() (this=0x555558da9460) at ../src/libavoid/router.cpp:541 #3 0x00007ffff6e9d1ce in SPDocument::ensureUpToDate() (this=0x5555565f6840) at ../src/document.cpp:1215 #4 0x00007ffff6e95d53 in Inkscape::DocumentUndo::maybeDone(SPDocument*, char const*, unsigned int, Glib::ustring const&) (doc=0x5555565f6840, key=0x7ffff74a3221 "selector:move:vertical", event_type=136, event_description=...) at ../src/document-undo.cpp:153 #5 0x00007ffff6f54b8e in sp_selection_move(Inkscape::Selection*, double, double) (selection=0x555556639e00, dx=0, dy=20) at ../src/selection-chemistry.cpp:2342 #6 0x00007ffff69db8b2 in Inkscape::UI::Tools::SelectTool::root_handler(_GdkEvent*) (this=0x5555572bf800, event=0x555558a200b0) at ../src/ui/tools/select-tool.cpp:946 #7 0x00007ffff69fad87 in Inkscape::UI::Tools::sp_event_context_virtual_root_handler(Inkscape::UI::Tools::ToolBase*, _GdkEvent*) (event_context=0x5555572bf800, event=0x555558a200b0) at ../src/ui/tools/tool-base.cpp:1003 #8 0x00007ffff69fad3d in Inkscape::UI::Tools::sp_event_context_root_handler(Inkscape::UI::Tools::ToolBase*, _GdkEvent*) (event_context=0x5555572bf800, event=0x---Type to continue, or q to quit---q Python Exception Quit: #9 0x00007ffff6e7aac5 in _arena_handler(SPCanvasArena*, Inkscape::DrawingItem*, GdkEvent*, SPDesktop*) (ai=0x0, event=0x555558a200b0, desktop=0x555556637c00) at ../src/desktop.cpp:1683 #10 0x00007ffff67bae56 in sp_marshal_INT__POINTER_POINTER(GClosure*, GValue*, guint, GValue const*, gpointer, gpointer) (closure=0x55555783ee50, return_value=0x7fffffffc910, n_param_values=3, param_values=0x7fffffffc7d0, invocation_hint=0x7fffffffc750, marshal_data=0x0) at src/helper/sp-marshal.cpp:242 #11 0x00007ffff1d5f10d in g_closure_invoke () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 r#12 0x00007ffff1d7205e in () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 #13 0x00007ffff1d7a0af in g_signal_emit_valist () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 #14 0x00007ffff1d7b12f in g_signal_emit () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 #15 0x00007ffff65f0dae in sp_canvas_arena_send_event(SPCanvasArena*, GdkEvent*) (arena=0x55555784c000, event=0x555558a200b0) at ../src/display/canvas-arena.cpp:325 #16 0x00007ffff65f0cf0 in sp_canvas_arena_event(SPCanvasItem*, GdkEvent*) (item=0x55555784c000, event=0x555558a200b0) at ../src/display/canvas-arena.cpp:312 #17 0x00007ffff67bab2a in sp_marshal_BOOLEAN__POINTER(GClosure*, GValue*, guint, GValue const*, gpointer, gpointer) (closure=0x555557799280, return_value=0x7fffffffcf20, n_param_values=2, param_values=0x7fffffffce00, invocation_hint=0x7fffffffcd80, marshal_data=0x7ffff65f0791 to continue, or q to quit---r ent*)>) at src/helper/sp-marshal.cpp:120 #18 0x00007ffff1d5f10d in g_closure_invoke () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 #19 0x00007ffff1d71de8 in () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 #20 0x00007ffff1d7a0af in g_signal_emit_valist () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 #21 0x00007ffff1d7b12f in g_signal_emit () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 #22 0x00007ffff6685cef in SPCanvas::emitEvent(_GdkEvent*) (this=0x555557194630, event=0x555558a1c720) at ../src/display/sp-canvas.cpp:1280 #23 0x00007ffff66876e5 in SPCanvas::handle_key_event(_GtkWidget*, _GdkEventKey*) (widget=0x555557194630, event=0x555558a1c720) at ../src/display/sp-canvas.cpp:1856 #24 0x00007ffff3ef038b in () at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 #25 0x00007ffff1d5f021 in g_closure_invoke () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 #26 0x00007ffff1d71de8 in () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 #27 0x00007ffff1d7a0af in g_signal_emit_valist () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 #28 0x00007ffff1d7b12f in g_signal_emit () at /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 #29 0x00007ffff40062bc in () at /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 #30 0x00007ffff4019a7d in gtk_window_propagate_key_event ()
Inkscape Version and Operating System:
- 0.92.4 (2247b618b6, 2019-05-02) Linux Mint 19.1
- Inkscape 0.92.1 r, Linux 4.10.4-1-ARCH
- lp:inkscape/0.92.x rev. 15407 Windows 7
- Inkscape 0.92.2+68~ubuntu16.04.1
I was unable to replicate in 1.0alpha, but it may just be because I did not test enough?