Crash on quit with grid shown (Indirect regression of !2106)
Steps to reproduce:
This is an indirect regression from !2106 (merged). The issue existed before but typically would not produce a crash because of differences in Glib/Glibmm memory management.
- open Inkscape
- show grid (View > Page Grid)
- close window (with or without saving)
Canvas::redraw_area but the canvas has already been destroyed.
==22738==ERROR: AddressSanitizer: heap-use-after-free on address 0x6150001cbce4 at pc 0x7f27c1fcdef9 bp 0x7fffe40475b0 sp 0x7fffe40475a8 READ of size 1 at 0x6150001cbce4 thread T0 #0 0x7f27c1fcdef8 in Inkscape::UI::Widget::Canvas::redraw_area(int, int, int, int) src/ui/widget/canvas.cpp:175:9 #1 0x7f27c109b2d1 in redraw_if_visible(SPCanvasItem*) src/display/sp-canvas-item.cpp:161:27 #2 0x7f27c109afe9 in sp_canvas_item_dispose(_GObject*) src/display/sp-canvas-item.cpp:192:11 #3 0x7f27be50a839 in g_object_run_dispose (/usr/lib/libgobject-2.0.so.0+0x14839) #4 0x7f27c109ad74 in sp_canvas_item_destroy(SPCanvasItem*) src/display/sp-canvas-item.cpp:171:5 #5 0x7f27c0fc4422 in Inkscape::CanvasGrid::~CanvasGrid() src/display/canvas-grid.cpp:165:9 #6 0x7f27c0fc7ac3 in Inkscape::CanvasXYGrid::~CanvasXYGrid() src/display/canvas-grid.cpp:448:1 #7 0x7f27c0fc7afd in Inkscape::CanvasXYGrid::~CanvasXYGrid() src/display/canvas-grid.cpp:446:1 #8 0x7f27c16ef27b in SPNamedView::release() src/object/sp-namedview.cpp:273:9 #9 0x7f27c170220c in SPObject::releaseReferences() src/object/sp-object.cpp:814:11 #10 0x7f27c1701f9c in SPObject::detach(SPObject*) src/object/sp-object.cpp:569:13 #11 0x7f27c1703225 in SPObject::release() src/object/sp-object.cpp:623:17 #12 0x7f27c164d3f4 in SPItem::release() src/object/sp-item.cpp:442:15 #13 0x7f27c165cdfb in SPLPEItem::release() src/object/sp-lpe-item.cpp:102:13 #14 0x7f27c1633dd4 in SPGroup::release() src/object/sp-item-group.cpp:80:16 #15 0x7f27c172a03a in SPRoot::release() src/object/sp-root.cpp:96:14 #16 0x7f27c170220c in SPObject::releaseReferences() src/object/sp-object.cpp:814:11 #17 0x7f27c22ba210 in SPDocument::~SPDocument() src/document.cpp:179:15 #18 0x7f27c22babcd in SPDocument::~SPDocument() src/document.cpp:148:27 #19 0x7f27c250efc1 in InkscapeApplication::document_close(SPDocument*) src/inkscape-application.cpp:285:9 #20 0x7f27c2511d1d in ConcreteInkscapeApplication<Gtk::Application>::destroy_window(InkscapeWindow*) src/inkscape-application.cpp:896:17
What should have happened?
Inkscape Version and Operating System:
- Inkscape Version:
Inkscape 1.1-dev (93759687eb, 2020-07-04, custom)
- Operating System: Arch Linux