solvespace / solvespace

Parametric 2d/3d CAD
http://solvespace.com/
GNU General Public License v3.0
3.1k stars 473 forks source link

Segmentation fault on opening SLVS file saved in previous session #960

Closed ghost closed 3 years ago

ghost commented 3 years ago

System information

Expected behavior

.slvs file saved with SolveSpace should be opened in same version of SolveSpace.

Actual behavior

SolveSpace crashed just on opening .slvs, which was created just with it.

$ solvespace
SolveSpace!

(solvespace:13293): Gtk-WARNING **: 19:09:33.924: gtk_window_present_with_time() should not be called with 0, or GDK_CURRENT_TIME as a timestamp, the timestamp should instead be gathered at the time the user initiated the request for the window to be shown
Generate::REGEN (for bounding box) took 96 ms
Generate::REGEN took 193 ms
Generate::ALL (for bounding box) took 108 ms
bad, edge_inters=4
bad, edge_inters=4
bad, edge_inters=4
bad, edge_inters=4
bad, edge_inters=4
bad, edge_inters=4
Generate::ALL took 360 ms
Generate::DIRTY (for bounding box) took 80 ms
bad, edge_inters=4
bad, edge_inters=4
bad, edge_inters=4
bad, edge_inters=4
Generate::DIRTY took 199 ms
Segmentation fault

Additional information

robnee commented 3 years ago

I could not reproduce this on linux using this model. I tried running through valgrind as well and didn't turn up anything interesting. Could be related to #935.

ghost commented 3 years ago

I could not reproduce this on linux using this model.

Does this file opens successfully for You? (may show a screenshot)

@robnee, Could you try to open it with a Debian/Ubuntu DEB package from @AlexanderP's PPA:

JFTR, @AlexanderP, could you take a look on https://github.com/solvespace/solvespace/issues/893?

phkahler commented 3 years ago

The file opens fine for me on Fedora 33 Linux. It is probably related to the other Debian crash, but I don't know what could be causing it. The Mimalloc stuff was for ARM, not intel, but they will have an update hopefully soon with several fixes we want.

ghost commented 3 years ago

I don't know what could be causing it.

@phkahler, FTR, SolveSpace failed only on this testcase .slvs file actually. Here is backtrace:

GDB Backtrace Log ```Shell $ gdb solvespace GNU gdb (Debian 8.2.1-2+b3) 8.2.1 Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from solvespace...(no debugging symbols found)...done. (gdb) run Starting program: /usr/bin/solvespace [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7fffedae7700 (LWP 9689)] [New Thread 0x7fffed2e6700 (LWP 9690)] SolveSpace! [New Thread 0x7fffe634b700 (LWP 9691)] [New Thread 0x7fffe5a09700 (LWP 9692)] [New Thread 0x7fffe5208700 (LWP 9693)] [New Thread 0x7fffe4a07700 (LWP 9694)] [New Thread 0x7fffdb816700 (LWP 9695)] (solvespace:9682): Gtk-WARNING **: 16:23:44.965: gtk_window_present_with_time() should not be called with 0, or GDK_CURRENT_TIME as a timestamp, the timestamp should instead be gathered at the time the user initiated the request for the window to be shown [New Thread 0x7fffd890b700 (LWP 9697)] [New Thread 0x7fffc260f700 (LWP 9698)] [New Thread 0x7fffc1e0e700 (LWP 9699)] [New Thread 0x7fffc160d700 (LWP 9700)] [New Thread 0x7fffc0e0c700 (LWP 9704)] [New Thread 0x7fffabfff700 (LWP 9705)] [New Thread 0x7fffab7fe700 (LWP 9706)] [New Thread 0x7fffaaffd700 (LWP 9707)] [New Thread 0x7fffaa7fc700 (LWP 9708)] [New Thread 0x7fffa9ffb700 (LWP 9709)] [New Thread 0x7fffa97fa700 (LWP 9710)] [Thread 0x7fffa9ffb700 (LWP 9709) exited] [Thread 0x7fffaaffd700 (LWP 9707) exited] [Thread 0x7fffc260f700 (LWP 9698) exited] [Thread 0x7fffaa7fc700 (LWP 9708) exited] [Thread 0x7fffa97fa700 (LWP 9710) exited] [Thread 0x7fffab7fe700 (LWP 9706) exited] [Thread 0x7fffc1e0e700 (LWP 9699) exited] [Thread 0x7fffd890b700 (LWP 9697) exited] [Thread 0x7fffc0e0c700 (LWP 9704) exited] Generate::REGEN (for bounding box) took 136 ms Generate::REGEN took 224 ms Generate::ALL (for bounding box) took 108 ms bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 Generate::ALL took 379 ms Generate::DIRTY (for bounding box) took 101 ms bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 Generate::DIRTY took 241 ms Thread 1 "solvespace" received signal SIGSEGV, Segmentation fault. 0x00007fffe6b621bc in ?? () from /usr/lib/x86_64-linux-gnu/dri/r300_dri.so (gdb) bt #0 0x00007fffe6b621bc in ?? () from /usr/lib/x86_64-linux-gnu/dri/r300_dri.so #1 0x00007fffe6b61d85 in ?? () from /usr/lib/x86_64-linux-gnu/dri/r300_dri.so #2 0x00007fffe6b144f2 in ?? () from /usr/lib/x86_64-linux-gnu/dri/r300_dri.so #3 0x00007fffe6c3ed45 in ?? () from /usr/lib/x86_64-linux-gnu/dri/r300_dri.so #4 0x00007fffe6c36625 in ?? () from /usr/lib/x86_64-linux-gnu/dri/r300_dri.so #5 0x00007fffe65f5d31 in ?? () from /usr/lib/x86_64-linux-gnu/dri/r300_dri.so #6 0x00007fffe65f76a1 in ?? () from /usr/lib/x86_64-linux-gnu/dri/r300_dri.so #7 0x00007fffe6603c78 in ?? () from /usr/lib/x86_64-linux-gnu/dri/r300_dri.so #8 0x00007fffe66007f9 in ?? () from /usr/lib/x86_64-linux-gnu/dri/r300_dri.so #9 0x00007fffe65f2712 in ?? () from /usr/lib/x86_64-linux-gnu/dri/r300_dri.so #10 0x00007fffe68486bd in ?? () from /usr/lib/x86_64-linux-gnu/dri/r300_dri.so #11 0x00005555555aa7b8 in ?? () #12 0x00005555555b9d65 in ?? () #13 0x00005555555b757b in ?? () #14 0x00005555555d3878 in ?? () #15 0x00005555555d5d50 in ?? () #16 0x00005555555c2eaf in ?? () #17 0x00007ffff7b4c55b in Gtk::GLArea_Class::render_callback(_GtkGLArea*, _GdkGLContext*) () from /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1 #18 0x00007ffff55d38ee in ffi_call_unix64 () from /lib/x86_64-linux-gnu/libffi.so.6 #19 0x00007ffff55d32bf in ffi_call () from /lib/x86_64-linux-gnu/libffi.so.6 #20 0x00007ffff6e43906 in g_cclosure_marshal_generic_va () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0 #21 0x00007ffff6e42ec6 in ?? () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0 #22 0x00007ffff6e5ed74 in g_signal_emit_valist () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0 #23 0x00007ffff6e5f97f in g_signal_emit () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0 #24 0x00007ffff7240abb in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #25 0x00007ffff7bbf60c in Gtk::Widget::on_draw(Cairo::RefPtr const&) () from /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1 #26 0x00007ffff7bca02f in Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) () from /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1 #27 0x00007ffff73cc734 in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #28 0x00007ffff71b779a in gtk_container_propagate_draw () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #29 0x00007ffff72278b1 in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #30 0x00007ffff7bbf60c in Gtk::Widget::on_draw(Cairo::RefPtr const&) () from /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1 #31 0x00007ffff7bca02f in Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) () from /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1 #32 0x00007ffff73cc734 in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #33 0x00007ffff71b779a in gtk_container_propagate_draw () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #34 0x00007ffff71b786d in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #35 0x00007ffff7169b24 in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #36 0x00007ffff71bc8fd in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #37 0x00007ffff71c15b2 in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #38 0x00007ffff716c3e1 in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #39 0x00007ffff7bc9f8e in Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) () from /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1 #40 0x00007ffff73cc734 in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #41 0x00007ffff71b779a in gtk_container_propagate_draw () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #42 0x00007ffff71b786d in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #43 0x00007ffff7169b24 in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #44 0x00007ffff71bc8fd in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #45 0x00007ffff71c15b2 in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #46 0x00007ffff716c3e1 in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #47 0x00007ffff7bc9f8e in Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) () from /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1 #48 0x00007ffff73cc734 in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #49 0x00007ffff71b779a in gtk_container_propagate_draw () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #50 0x00007ffff71b786d in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #51 0x00007ffff73da99a in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #52 0x00007ffff7bbf60c in Gtk::Widget::on_draw(Cairo::RefPtr const&) () from /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1 #53 0x00007ffff7bca02f in Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) () from /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1 #54 0x00007ffff73cc734 in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #55 0x00007ffff73d5758 in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #56 0x00007ffff7284941 in gtk_main_do_event () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #57 0x00007ffff6f84455 in ?? () from /lib/x86_64-linux-gnu/libgdk-3.so.0 #58 0x00007ffff6f9499e in ?? () from /lib/x86_64-linux-gnu/libgdk-3.so.0 #59 0x00007ffff6f95b16 in ?? () from /lib/x86_64-linux-gnu/libgdk-3.so.0 #60 0x00007ffff6f95cd4 in ?? () from /lib/x86_64-linux-gnu/libgdk-3.so.0 #61 0x00007ffff6e42c8d in g_closure_invoke () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0 #62 0x00007ffff6e56365 in ?? () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0 #63 0x00007ffff6e5f2be in g_signal_emit_valist () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0 #64 0x00007ffff6e5f97f in g_signal_emit () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0 #65 0x00007ffff6f8db6d in ?? () from /lib/x86_64-linux-gnu/libgdk-3.so.0 #66 0x00007ffff6f78c08 in ?? () from /lib/x86_64-linux-gnu/libgdk-3.so.0 #67 0x00007ffff6d61863 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #68 0x00007ffff6d60dd8 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #69 0x00007ffff6d611c8 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #70 0x00007ffff6d614c2 in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 #71 0x00007ffff7283a15 in gtk_main () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #72 0x0000555555597baa in ?? () #73 0x00007ffff64bf09b in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6 #74 0x000055555559cc0a in ?? () (gdb) ```

Also tested to create other .slvs file with just a simple cube — and SolveSpace reopens it successfully.

rpavlik commented 3 years ago

Weird, I don't even see SolveSpace in the backtrace, presumably it's some of the mystery entries and was build without symbols? Can you load the file to eg export to image, with SolveSpace cli? That would be a bit easier to step thru in a debugger if so.

ghost commented 3 years ago

was build without symbols?

Yep, @AlexanderP's PPA provide only DEB builds without debug symbols.

Can you load the file to eg export to image, with SolveSpace cli?

@rpavlik, What exact $ solvespace-cli <...> command should I use for this?

rpavlik commented 3 years ago

Had to check, I responded from mobile last time. Any of the commands should work, really. I just used the built-in help. Something like this will work as long as there's supposed to be a solid in there:

solvespace-cli export-mesh --output %.stl yourfile.slvs
ghost commented 3 years ago

Something like this will work as long as there's supposed to be a solid in there:

I just updated to SolveSpace 3.0~ https://github.com/solvespace/solvespace/commit/10ca307d986ab0c52faaab4fcaedb26bd42d1fd6 and here are results (TL;DR: it still reproducible IF try open this SLVS via file chooser dialog)

Successful

Terminal log ($ solvespace ./*.slvs) ``` $ solvespace ./dealwithit-glasess.slvs SolveSpace! Generate::ALL took 31 ms (solvespace:30331): Gtk-WARNING **: 17:00:54.282: gtk_window_present_with_time() should not be called with 0, or GDK_CURRENT_TIME as a timestamp, the timestamp should instead be gathered at the time the user initiated the request for the window to be shown Generate::REGEN (for bounding box) took 201 ms Generate::REGEN took 435 ms Generate::ALL (for bounding box) took 198 ms bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 Generate::ALL took 487 ms Generate::DIRTY (for bounding box) took 108 ms bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 Generate::DIRTY took 253 ms ```
Terminal log ($ solvespace-cli export-mesh --output name.stl file.slvs) ```Shell $ solvespace-cli export-mesh --output ./test.stl ./dealwithit-glasess.slvs Missing (absent) translation for group-name'#references' Missing (absent) translation for group-name'sketch-in-plane' Generate::REGEN (for bounding box) took 132 ms Generate::REGEN took 231 ms Generate::ALL (for bounding box) took 137 ms bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 Generate::ALL took 363 ms bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 Generate::ALL took 194 ms Written './test.stl'. ```

Failed

BUT SolveSpace still failed if try to open this SLVS via file chooser dialog:

  1. Launch SolveSpace in GUI mode (via Terminal or via Launch icon)
  2. Open "File > Open..." dialog;
  3. Select this SLVS file (i.e. dealwithit-glasess.slvs) and click Open button;
  4. SolveSpace crashed (in terminal it shows Segmentation fault)
$ solvespace
SolveSpace!

(solvespace:30405): Gtk-WARNING **: 17:04:28.931: gtk_window_present_with_time() should not be called with 0, or GDK_CURRENT_TIME as a timestamp, the timestamp should instead be gathered at the time the user initiated the request for the window to be shown
Generate::REGEN (for bounding box) took 109 ms
Generate::REGEN took 227 ms
Generate::ALL (for bounding box) took 125 ms
bad, edge_inters=4
bad, edge_inters=4
bad, edge_inters=4
bad, edge_inters=4
bad, edge_inters=4
bad, edge_inters=4
Generate::ALL took 430 ms
Generate::DIRTY (for bounding box) took 83 ms
bad, edge_inters=4
bad, edge_inters=4
bad, edge_inters=4
bad, edge_inters=4
Generate::DIRTY took 215 ms
Segmentation fault
rpavlik commented 3 years ago

oh that's very interesting, so it is actually related to the file dialog somehow.

robnee commented 3 years ago

Do we know if gtkmm is > 3.24.0? i.e. using the native file chooser?

ghost commented 3 years ago

Do we know if gtkmm is > 3.24.0?

As I use Debian 10, I has gtkmm3.0 (3.24.0-2)

And actually only this SLVS file triggers segmentation fault — other SLVS files SolveSpace opens as expected.

NOTE: While $ solvespace *.slvs still could be used for open this file in GUI mode, I already tried to re-save this file — BUT re-saved file also crashes SolveSpace to open this SLVS via file chooser dialog.

ghost commented 3 years ago

Thanks @AlexanderP for sending me solvespace-dbgsym_3.0.0~git1710-10ca307-1_*.deb — for curious reasons, after install it now SolveSpace NOT fails on opening testcase file (i.e. dailysolvespace-20210309_1.slvs)

BUT, I just tested to run it with gdb and all seems work as expected (even opening testcase file via file chooser dialog), until I closed SolveSpace via "File > Exit" — is "Segmentation fault" on closing SolveSpace is expected?

Here is backtrace log with dbgsym installed:

Backtrace Log (SolveSpace `3.0~10ca307`) ```Shell user@user:~ $ gdb solvespace GNU gdb (Debian 8.2.1-2+b3) 8.2.1 Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from solvespace...Reading symbols from /usr/lib/debug/.build-id/03/16c1010af7886af3059da7b2af8402e0f297f5.debug...done. done. (gdb) run Starting program: /usr/bin/solvespace [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7fffedaeb700 (LWP 5861)] [New Thread 0x7fffed2ea700 (LWP 5862)] SolveSpace! Generate::ALL took 31 ms [New Thread 0x7fffe6339700 (LWP 5863)] [New Thread 0x7fffe59f7700 (LWP 5864)] [New Thread 0x7fffe51f6700 (LWP 5865)] [New Thread 0x7fffe49f5700 (LWP 5866)] [New Thread 0x7fffdaeea700 (LWP 5867)] (solvespace:5857): Gtk-WARNING **: 00:19:40.210: gtk_window_present_with_time() should not be called with 0, or GDK_CURRENT_TIME as a timestamp, the timestamp should instead be gathered at the time the user initiated the request for the window to be shown [New Thread 0x7fffc260f700 (LWP 5870)] [New Thread 0x7fffc1e0e700 (LWP 5871)] [New Thread 0x7fffc160d700 (LWP 5872)] [New Thread 0x7fffc0e0c700 (LWP 5873)] [New Thread 0x7fffb3fff700 (LWP 5878)] [New Thread 0x7fffb37fe700 (LWP 5879)] [New Thread 0x7fffb2ffd700 (LWP 5880)] [New Thread 0x7fffb27fc700 (LWP 5881)] [Thread 0x7fffb37fe700 (LWP 5879) exited] [Thread 0x7fffb3fff700 (LWP 5878) exited] [Thread 0x7fffb2ffd700 (LWP 5880) exited] [Thread 0x7fffc1e0e700 (LWP 5871) exited] [Thread 0x7fffb27fc700 (LWP 5881) exited] [Thread 0x7fffc260f700 (LWP 5870) exited] Generate::REGEN (for bounding box) took 106 ms Generate::REGEN took 204 ms Generate::ALL (for bounding box) took 110 ms bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 Generate::ALL took 377 ms Generate::DIRTY (for bounding box) took 102 ms bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 Generate::DIRTY took 238 ms [Thread 0x7fffc160d700 (LWP 5872) exited] [New Thread 0x7fffc160d700 (LWP 5894)] [New Thread 0x7fffc260f700 (LWP 5895)] [New Thread 0x7fffb27fc700 (LWP 5896)] [Thread 0x7fffc160d700 (LWP 5894) exited] [Thread 0x7fffc260f700 (LWP 5895) exited] Generate::ALL (for bounding box) took 102 ms bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 bad, edge_inters=4 Generate::ALL took 361 ms Thread 1 "solvespace" received signal SIGSEGV, Segmentation fault. 0x0000000000000000 in ?? () (gdb) bt #0 0x0000000000000000 in ?? () #1 0x00007fffe6b5e19b in ?? () from /usr/lib/x86_64-linux-gnu/dri/r300_dri.so #2 0x00007fffe65f117e in ?? () from /usr/lib/x86_64-linux-gnu/dri/r300_dri.so #3 0x00007fffe65f244c in ?? () from /usr/lib/x86_64-linux-gnu/dri/r300_dri.so #4 0x00007fffe65cc8be in ?? () from /usr/lib/x86_64-linux-gnu/dri/r300_dri.so #5 0x00007fffe6b5c7b3 in ?? () from /usr/lib/x86_64-linux-gnu/dri/r300_dri.so #6 0x00007fffec18114f in ?? () from /lib/x86_64-linux-gnu/libGLX_mesa.so.0 #7 0x00007fffec170c09 in ?? () from /lib/x86_64-linux-gnu/libGLX_mesa.so.0 #8 0x00007ffff6fb654d in ?? () from /lib/x86_64-linux-gnu/libgdk-3.so.0 #9 0x00007ffff6e47db3 in g_object_unref () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0 #10 0x00007ffff723f612 in ?? () from /lib/x86_64-linux-gnu/libgtk-3.so.0 #11 0x00007ffff6e495f8 in g_object_run_dispose () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0 #12 0x00007ffff7beeec8 in Gtk::Object::_release_c_instance() () from /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1 #13 0x00007ffff7b4ccbc in Gtk::GLArea::~GLArea() () from /lib/x86_64-linux-gnu/libgtkmm-3.0.so.1 #14 0x00005555555ceaa7 in SolveSpace::Platform::GtkGLWidget::~GtkGLWidget (this=0x555555cb16e8, __in_chrg=, __vtt_parm=) at ./src/platform/guigtk.cpp:443 #15 SolveSpace::Platform::GtkEditorOverlay::~GtkEditorOverlay (this=0x555555cb16c0, __in_chrg=, __vtt_parm=) at ./src/platform/guigtk.cpp:610 #16 SolveSpace::Platform::GtkWindow::~GtkWindow (this=0x555555cb15e8, __in_chrg=, __vtt_parm=) at ./src/platform/guigtk.cpp:728 #17 SolveSpace::Platform::WindowImplGtk::~WindowImplGtk (this=0x555555cb14e0, __in_chrg=) at ./src/platform/guigtk.cpp:848 #18 __gnu_cxx::new_allocator::destroy (this=0x555555cb14e0, __p=0x555555cb14e0) at /usr/include/c++/8/ext/new_allocator.h:140 #19 std::allocator_traits >::destroy (__a=..., __p=0x555555cb14e0) at /usr/include/c++/8/bits/alloc_traits.h:487 #20 std::_Sp_counted_ptr_inplace, (__gnu_cxx::_Lock_policy)2>::_M_dispose (this=0x555555cb14d0) at /usr/include/c++/8/bits/shared_ptr_base.h:554 #21 0x00005555555a6192 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x555555cb14d0) at /usr/include/c++/8/ext/atomicity.h:69 #22 std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x555555cb14d0) at /usr/include/c++/8/bits/shared_ptr_base.h:148 #23 0x00005555555a0fa3 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=, __in_chrg=) at /usr/include/c++/8/bits/shared_ptr_base.h:1167 #24 std::__shared_ptr::~__shared_ptr (this=, __in_chrg=) at /usr/include/c++/8/bits/shared_ptr_base.h:1167 #25 std::__shared_ptr::operator= (__r=..., this=) at /usr/include/c++/8/bits/shared_ptr_base.h:1263 #26 std::shared_ptr::operator= (__r=..., this=) at /usr/include/c++/8/bits/shared_ptr.h:335 #27 SolveSpace::SolveSpaceUI::Clear (this=0x5555558ee4c0 ) at ./src/solvespace.cpp:1023 #28 0x000055555559820b in main (argc=, argv=) at ./src/platform/entrygui.cpp:30 (gdb) ```
rpavlik commented 3 years ago

Hmm. So on a locally-built copy of SolveSpace, on Debian 10, latest master branch (3.0~0e0b0252) this loads fine through the GUI and file dialog, no crash. I have some stuff installed from backports but I'm reasonably sure nobody put gtkmm in backports, too intrusive... (and that's a pretty cool model)

Though, it does look like I have some sanitizers enabled still? Mostly new-delete-type-mismatch. Allocated and destroyed in a timer GTK thing, for most of them. Here's what look like the different unique variants:

==4046==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x60600030fbc0 in thread T0:
  object passed to delete has wrong type:
  size of the allocated type:   56 bytes;
  size of the deallocated type: 48 bytes.
    #0 0x7ffff7283128 in operator delete(void*, unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xec128)
    #1 0x5555560e352c in sigc::slot0<bool>::~slot0() /usr/include/sigc++-2.0/sigc++/functors/slot.h:515
    #2 0x5555560e352c in sigc::slot<bool, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil>::~slot() /usr/include/sigc++-2.0/sigc++/functors/slot.h:1761
    #3 0x5555560e352c in SolveSpace::Platform::TimerImplGtk::RunAfter(unsigned int) ../src/platform/guigtk.cpp:225
    #4 0x55555611675e in SolveSpace::GraphicsWindow::ClearSelection() ../src/draw.cpp:82
    #5 0x555556350d08 in SolveSpace::GraphicsWindow::ClearSuper() ../src/graphicswin.cpp:1354
    #6 0x555556609d80 in SolveSpace::TextWindow::ScreenActivateGroup(int, unsigned int) ../src/textscreens.cpp:71
    #7 0x55555663386a in SolveSpace::TextWindow::MouseEvent(bool, bool, double, double) ../src/textwin.cpp:1120
    #8 0x5555566340dd in operator() ../src/textwin.cpp:249
    #9 0x5555566340dd in _M_invoke /usr/include/c++/8/bits/std_function.h:282
    #10 0x5555560ef7c0 in std::function<bool (SolveSpace::Platform::MouseEvent)>::operator()(SolveSpace::Platform::MouseEvent) const /usr/include/c++/8/bits/std_function.h:687
    #11 0x5555560ef7c0 in SolveSpace::Platform::GtkGLWidget::process_pointer_event(SolveSpace::Platform::MouseEvent::Type, double, double, unsigned int, unsigned int, double) ../src/platform/guigtk.cpp:503
    #12 0x5555560eff84 in SolveSpace::Platform::GtkGLWidget::on_button_press_event(_GdkEventButton*) ../src/platform/guigtk.cpp:527
    #13 0x7ffff6da2a83 in Gtk::Widget_Class::button_press_event_callback(_GtkWidget*, _GdkEventButton*) (/usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1+0x3d7a83)
    #14 0x7ffff65f5273 in _gtk_marshal_BOOLEAN__BOXEDv ../../../../gtk/gtkmarshalers.c:129
    #15 0x7ffff6025ec5 in _g_closure_invoke_va ../../../gobject/gclosure.c:873
    #16 0x7ffff6041d73 in g_signal_emit_valist ../../../gobject/gsignal.c:3300
    #17 0x7ffff604297e in g_signal_emit ../../../gobject/gsignal.c:3447
    #18 0x7ffff65a3323 in gtk_widget_event_internal ../../../../gtk/gtkwidget.c:7744
    #19 0x7ffff6463975 in propagate_event_up ../../../../gtk/gtkmain.c:2592
    #20 0x7ffff6463975 in propagate_event ../../../../gtk/gtkmain.c:2695
    #21 0x7ffff6465a82 in gtk_main_do_event ../../../../gtk/gtkmain.c:1915
    #22 0x7ffff6465a82 in gtk_main_do_event ../../../../gtk/gtkmain.c:1685
    #23 0x7ffff6167464 in _gdk_event_emit ../../../../gdk/gdkevents.c:73
    #24 0x7ffff6198111 in gdk_event_source_dispatch ../../../../../gdk/x11/gdkeventsource.c:367
    #25 0x7ffff5f41f2d in g_main_dispatch ../../../glib/gmain.c:3182
    #26 0x7ffff5f41f2d in g_main_context_dispatch ../../../glib/gmain.c:3847
    #27 0x7ffff5f421c7 in g_main_context_iterate ../../../glib/gmain.c:3920
    #28 0x7ffff5f424c1 in g_main_loop_run ../../../glib/gmain.c:4116
    #29 0x7ffff6464b14 in gtk_main ../../../../gtk/gtkmain.c:1323
    #30 0x55555601d576 in main ../src/platform/entrygui.cpp:27
    #31 0x7ffff4b8a09a in __libc_start_main ../csu/libc-start.c:308
    #32 0x55555602d0f9 in _start (/home/ryan/src/third-party/solvespace/build/bin/solvespace+0xad90f9)

0x60600030fbc0 is located 0 bytes inside of 56-byte region [0x60600030fbc0,0x60600030fbf8)
allocated by thread T0 here:
    #0 0x7ffff7281d30 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xead30)
    #1 0x5555560e3312 in sigc::slot0<bool>::slot0<SolveSpace::Platform::TimerImplGtk::RunAfter(unsigned int)::{lambda()#1}>(SolveSpace::Platform::TimerImplGtk::RunAfter(unsigned int)::{lambda()#1} const&) /usr/include/sigc++-2.0/sigc++/functors/slot.h:546
    #2 0x5555560e3312 in sigc::slot<bool, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil>::slot<SolveSpace::Platform::TimerImplGtk::RunAfter(unsigned int)::{lambda()#1}>(SolveSpace::Platform::TimerImplGtk::RunAfter(unsigned int)::{lambda()#1} const&) /usr/include/sigc++-2.0/sigc++/functors/slot.h:1774
    #3 0x5555560e3312 in SolveSpace::Platform::TimerImplGtk::RunAfter(unsigned int) ../src/platform/guigtk.cpp:225

SUMMARY: AddressSanitizer: new-delete-type-mismatch (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xec128) in operator delete(void*, unsigned long)
==4046==HINT: if you don't care about these errors you may set ASAN_OPTIONS=new_delete_type_mismatch=0
bad, edge_inters=4
bad, edge_inters=4
bad, edge_inters=4
bad, edge_inters=4
Generate::DIRTY took 45 ms
=================================================================
==4046==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x606000580640 in thread T0:
  object passed to delete has wrong type:
  size of the allocated type:   56 bytes;
  size of the deallocated type: 48 bytes.
    #0 0x7ffff7283128 in operator delete(void*, unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xec128)
    #1 0x7ffff60cdce0 in ~SourceConnectionNode glib/glibmm/main.cc:65
    #2 0x7ffff60cdce0 in destroy_notify_callback glib/glibmm/main.cc:118
    #3 0x7ffff5f3e7e2 in g_source_callback_unref ../../../glib/gmain.c:1551
    #4 0x7ffff5f3e7e2 in g_source_callback_unref ../../../glib/gmain.c:1544
    #5 0x7ffff5f3f20d in g_source_destroy_internal ../../../glib/gmain.c:1236
    #6 0x7ffff5f41e67 in g_main_dispatch ../../../glib/gmain.c:3206
    #7 0x7ffff5f41e67 in g_main_context_dispatch ../../../glib/gmain.c:3847
    #8 0x7ffff5f421c7 in g_main_context_iterate ../../../glib/gmain.c:3920
    #9 0x7ffff5f424c1 in g_main_loop_run ../../../glib/gmain.c:4116
    #10 0x7ffff6464b14 in gtk_main ../../../../gtk/gtkmain.c:1323
    #11 0x55555601d576 in main ../src/platform/entrygui.cpp:27
    #12 0x7ffff4b8a09a in __libc_start_main ../csu/libc-start.c:308
    #13 0x55555602d0f9 in _start (/home/ryan/src/third-party/solvespace/build/bin/solvespace+0xad90f9)

0x606000580640 is located 0 bytes inside of 56-byte region [0x606000580640,0x606000580678)
allocated by thread T0 here:
    #0 0x7ffff7281d30 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xead30)
    #1 0x5555560de26d in sigc::internal::typed_slot_rep<SolveSpace::Platform::TimerImplGtk::RunAfter(unsigned int)::{lambda()#1}>::dup(void*) /usr/include/sigc++-2.0/sigc++/functors/slot.h:111
    #2 0x555556b810af  (/home/ryan/src/third-party/solvespace/build/bin/solvespace+0x162d0af)

SUMMARY: AddressSanitizer: new-delete-type-mismatch (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xec128) in operator delete(void*, unsigned long)
==4046==HINT: if you don't care about these errors you may set ASAN_OPTIONS=new_delete_type_mismatch=0
=================================================================
==4046==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x60600030c4a0 in thread T0:
  object passed to delete has wrong type:
  size of the allocated type:   56 bytes;
  size of the deallocated type: 48 bytes.
    #0 0x7ffff7283128 in operator delete(void*, unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xec128)
    #1 0x7ffff60cdce0 in ~SourceConnectionNode glib/glibmm/main.cc:65
    #2 0x7ffff60cdce0 in destroy_notify_callback glib/glibmm/main.cc:118
    #3 0x7ffff5f3e7e2 in g_source_callback_unref ../../../glib/gmain.c:1551
    #4 0x7ffff5f3e7e2 in g_source_callback_unref ../../../glib/gmain.c:1544
    #5 0x7ffff5f3f20d in g_source_destroy_internal ../../../glib/gmain.c:1236
    #6 0x7ffff5f41e67 in g_main_dispatch ../../../glib/gmain.c:3206
    #7 0x7ffff5f41e67 in g_main_context_dispatch ../../../glib/gmain.c:3847
    #8 0x7ffff5f421c7 in g_main_context_iterate ../../../glib/gmain.c:3920
    #9 0x7ffff5f424c1 in g_main_loop_run ../../../glib/gmain.c:4116
    #10 0x7ffff6464b14 in gtk_main ../../../../gtk/gtkmain.c:1323
    #11 0x55555601d576 in main ../src/platform/entrygui.cpp:27
    #12 0x7ffff4b8a09a in __libc_start_main ../csu/libc-start.c:308
    #13 0x55555602d0f9 in _start (/home/ryan/src/third-party/solvespace/build/bin/solvespace+0xad90f9)

0x60600030c4a0 is located 0 bytes inside of 56-byte region [0x60600030c4a0,0x60600030c4d8)
allocated by thread T0 here:
    #0 0x7ffff7281d30 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xead30)
    #1 0x5555560de26d in sigc::internal::typed_slot_rep<SolveSpace::Platform::TimerImplGtk::RunAfter(unsigned int)::{lambda()#1}>::dup(void*) /usr/include/sigc++-2.0/sigc++/functors/slot.h:111
    #2 0x555556b810af  (/home/ryan/src/third-party/solvespace/build/bin/solvespace+0x162d0af)

SUMMARY: AddressSanitizer: new-delete-type-mismatch (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xec128) in operator delete(void*, unsigned long)
==4046==HINT: if you don't care about these errors you may set ASAN_OPTIONS=new_delete_type_mismatch=0
=================================================================
==4046==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x6080000405a0 in thread T0:
  object passed to delete has wrong type:
  size of the allocated type:   88 bytes;
  size of the deallocated type: 48 bytes.
    #0 0x7ffff7283128 in operator delete(void*, unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xec128)
    #1 0x7ffff60d3139 in Glib::SignalProxyConnectionNode::~SignalProxyConnectionNode() ../glibmm/signalproxy_connectionnode.h:39
    #2 0x7ffff60d3139 in Glib::SignalProxyConnectionNode::destroy_notify_handler(void*, _GClosure*) glib/glibmm/signalproxy_connectionnode.cc:96
    #3 0x7ffff60253c3 in closure_invoke_notifiers ../../../gobject/gclosure.c:263
    #4 0x7ffff60253c3 in g_closure_unref ../../../gobject/gclosure.c:615
    #5 0x7ffff60253c3 in g_closure_unref ../../../gobject/gclosure.c:601
    #6 0x7ffff60402e3 in handler_unref_R ../../../gobject/gsignal.c:700
    #7 0x7ffff60402e3 in g_signal_handlers_destroy ../../../gobject/gsignal.c:2714
    #8 0x7ffff602a3ec in g_object_real_dispose ../../../gobject/gobject.c:1054
    #9 0x7ffff602adb2 in g_object_unref ../../../gobject/gobject.c:3309
    #10 0x7ffff602adb2 in g_object_unref ../../../gobject/gobject.c:3238
    #11 0x7ffff64c2340 in gtk_range_destroy ../../../../gtk/gtkrange.c:1781
    #12 0x7ffff6025c8c in g_closure_invoke ../../../gobject/gclosure.c:810
    #13 0x7ffff6039675 in signal_emit_unlocked_R ../../../gobject/gsignal.c:3751
    #14 0x7ffff60422bd in g_signal_emit_valist ../../../gobject/gsignal.c:3391
    #15 0x7ffff604297e in g_signal_emit ../../../gobject/gsignal.c:3447
    #16 0x7ffff65ac30b in gtk_widget_dispose ../../../../gtk/gtkwidget.c:12098
    #17 0x7ffff602c5f7 in g_object_run_dispose ../../../gobject/gobject.c:1108
    #18 0x7ffff6dd0ec7 in Gtk::Object::_release_c_instance() (/usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1+0x405ec7)
    #19 0x7ffff6dbf266 in Gtk::VScrollbar::~VScrollbar() (/usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1+0x3f4266)
    #20 0x55555610b99a in SolveSpace::Platform::GtkWindow::~GtkWindow() ../src/platform/guigtk.cpp:733
    #21 0x55555610ceba in SolveSpace::Platform::WindowImplGtk::~WindowImplGtk() ../src/platform/guigtk.cpp:853
    #22 0x55555610ceba in void __gnu_cxx::new_allocator<SolveSpace::Platform::WindowImplGtk>::destroy<SolveSpace::Platform::WindowImplGtk>(SolveSpace::Platform::WindowImplGtk*) /usr/include/c++/8/ext/new_allocator.h:140
    #23 0x55555610ceba in void std::allocator_traits<std::allocator<SolveSpace::Platform::WindowImplGtk> >::destroy<SolveSpace::Platform::WindowImplGtk>(std::allocator<SolveSpace::Platform::WindowImplGtk>&, SolveSpace::Platform::WindowImplGtk*) /usr/include/c++/8/bits/alloc_traits.h:487
    #24 0x55555610ceba in std::_Sp_counted_ptr_inplace<SolveSpace::Platform::WindowImplGtk, std::allocator<SolveSpace::Platform::WindowImplGtk>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() /usr/include/c++/8/bits/shared_ptr_base.h:554
    #25 0x555556060b44 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/include/c++/8/bits/shared_ptr_base.h:155
    #26 0x555556060b44 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/include/c++/8/bits/shared_ptr_base.h:148
    #27 0x55555603538f in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/include/c++/8/bits/shared_ptr_base.h:728
    #28 0x55555603538f in std::__shared_ptr<SolveSpace::Platform::Window, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/include/c++/8/bits/shared_ptr_base.h:1167
    #29 0x55555603538f in std::__shared_ptr<SolveSpace::Platform::Window, (__gnu_cxx::_Lock_policy)2>::operator=(std::__shared_ptr<SolveSpace::Platform::Window, (__gnu_cxx::_Lock_policy)2>&&) /usr/include/c++/8/bits/shared_ptr_base.h:1263
    #30 0x55555603538f in std::shared_ptr<SolveSpace::Platform::Window>::operator=(std::shared_ptr<SolveSpace::Platform::Window>&&) /usr/include/c++/8/bits/shared_ptr.h:335
    #31 0x55555603538f in SolveSpace::SolveSpaceUI::Clear() ../src/solvespace.cpp:1023
    #32 0x55555601d587 in main ../src/platform/entrygui.cpp:30
    #33 0x7ffff4b8a09a in __libc_start_main ../csu/libc-start.c:308
    #34 0x55555602d0f9 in _start (/home/ryan/src/third-party/solvespace/build/bin/solvespace+0xad90f9)

0x6080000405a0 is located 0 bytes inside of 88-byte region [0x6080000405a0,0x6080000405f8)
allocated by thread T0 here:
    #0 0x7ffff7281d30 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xead30)
    #1 0x5555561099e8 in sigc::slot0<void>::slot0<sigc::bound_mem_functor0<void, SolveSpace::Platform::GtkWindow> >(sigc::bound_mem_functor0<void, SolveSpace::Platform::GtkWindow> const&) /usr/include/sigc++-2.0/sigc++/functors/slot.h:546
    #2 0x5555561099e8 in sigc::slot<void, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil>::slot<sigc::bound_mem_functor0<void, SolveSpace::Platform::GtkWindow> >(sigc::bound_mem_functor0<void, SolveSpace::Platform::GtkWindow> const&) /usr/include/sigc++-2.0/sigc++/functors/slot.h:1774
    #3 0x5555561099e8 in SolveSpace::Platform::GtkWindow::GtkWindow(SolveSpace::Platform::Window*) ../src/platform/guigtk.cpp:758
    #4 0x6190003d6d8f  (<unknown module>)

SUMMARY: AddressSanitizer: new-delete-type-mismatch (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xec128) in operator delete(void*, unsigned long)
==4046==HINT: if you don't care about these errors you may set ASAN_OPTIONS=new_delete_type_mismatch=0
=================================================================
==4046==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x608000040520 in thread T0:
  object passed to delete has wrong type:
  size of the allocated type:   88 bytes;
  size of the deallocated type: 48 bytes.
    #0 0x7ffff7283128 in operator delete(void*, unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xec128)
    #1 0x7ffff60d3139 in Glib::SignalProxyConnectionNode::~SignalProxyConnectionNode() ../glibmm/signalproxy_connectionnode.h:39
    #2 0x7ffff60d3139 in Glib::SignalProxyConnectionNode::destroy_notify_handler(void*, _GClosure*) glib/glibmm/signalproxy_connectionnode.cc:96
    #3 0x7ffff60253c3 in closure_invoke_notifiers ../../../gobject/gclosure.c:263
    #4 0x7ffff60253c3 in g_closure_unref ../../../gobject/gclosure.c:615
    #5 0x7ffff60253c3 in g_closure_unref ../../../gobject/gclosure.c:601
    #6 0x7ffff60402e3 in handler_unref_R ../../../gobject/gsignal.c:700
    #7 0x7ffff60402e3 in g_signal_handlers_destroy ../../../gobject/gsignal.c:2714
    #8 0x7ffff602a3ec in g_object_real_dispose ../../../gobject/gobject.c:1054
    #9 0x7ffff602c5f7 in g_object_run_dispose ../../../gobject/gobject.c:1108
    #10 0x7ffff6dd0ec7 in Gtk::Object::_release_c_instance() (/usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1+0x405ec7)
    #11 0x7ffff6d14cc1 in Gtk::Entry::~Entry() (/usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1+0x349cc1)
    #12 0x55555610ba83 in SolveSpace::Platform::GtkEditorOverlay::~GtkEditorOverlay() ../src/platform/guigtk.cpp:615
    #13 0x55555610ba83 in SolveSpace::Platform::GtkWindow::~GtkWindow() ../src/platform/guigtk.cpp:733
    #14 0x55555610ceba in SolveSpace::Platform::WindowImplGtk::~WindowImplGtk() ../src/platform/guigtk.cpp:853
    #15 0x55555610ceba in void __gnu_cxx::new_allocator<SolveSpace::Platform::WindowImplGtk>::destroy<SolveSpace::Platform::WindowImplGtk>(SolveSpace::Platform::WindowImplGtk*) /usr/include/c++/8/ext/new_allocator.h:140
    #16 0x55555610ceba in void std::allocator_traits<std::allocator<SolveSpace::Platform::WindowImplGtk> >::destroy<SolveSpace::Platform::WindowImplGtk>(std::allocator<SolveSpace::Platform::WindowImplGtk>&, SolveSpace::Platform::WindowImplGtk*) /usr/include/c++/8/bits/alloc_traits.h:487
    #17 0x55555610ceba in std::_Sp_counted_ptr_inplace<SolveSpace::Platform::WindowImplGtk, std::allocator<SolveSpace::Platform::WindowImplGtk>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() /usr/include/c++/8/bits/shared_ptr_base.h:554
    #18 0x555556060b44 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/include/c++/8/bits/shared_ptr_base.h:155
    #19 0x555556060b44 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/include/c++/8/bits/shared_ptr_base.h:148
    #20 0x55555603538f in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/include/c++/8/bits/shared_ptr_base.h:728
    #21 0x55555603538f in std::__shared_ptr<SolveSpace::Platform::Window, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/include/c++/8/bits/shared_ptr_base.h:1167
    #22 0x55555603538f in std::__shared_ptr<SolveSpace::Platform::Window, (__gnu_cxx::_Lock_policy)2>::operator=(std::__shared_ptr<SolveSpace::Platform::Window, (__gnu_cxx::_Lock_policy)2>&&) /usr/include/c++/8/bits/shared_ptr_base.h:1263
    #23 0x55555603538f in std::shared_ptr<SolveSpace::Platform::Window>::operator=(std::shared_ptr<SolveSpace::Platform::Window>&&) /usr/include/c++/8/bits/shared_ptr.h:335
    #24 0x55555603538f in SolveSpace::SolveSpaceUI::Clear() ../src/solvespace.cpp:1023
    #25 0x55555601d587 in main ../src/platform/entrygui.cpp:30
    #26 0x7ffff4b8a09a in __libc_start_main ../csu/libc-start.c:308
    #27 0x55555602d0f9 in _start (/home/ryan/src/third-party/solvespace/build/bin/solvespace+0xad90f9)

0x608000040520 is located 0 bytes inside of 88-byte region [0x608000040520,0x608000040578)
allocated by thread T0 here:
    #0 0x7ffff7281d30 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xead30)
    #1 0x5555561092f5 in sigc::slot0<void>::slot0<sigc::bound_mem_functor0<void, SolveSpace::Platform::GtkEditorOverlay> >(sigc::bound_mem_functor0<void, SolveSpace::Platform::GtkEditorOverlay> const&) /usr/include/sigc++-2.0/sigc++/functors/slot.h:546
    #2 0x5555561092f5 in sigc::slot<void, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil>::slot<sigc::bound_mem_functor0<void, SolveSpace::Platform::GtkEditorOverlay> >(sigc::bound_mem_functor0<void, SolveSpace::Platform::GtkEditorOverlay> const&) /usr/include/sigc++-2.0/sigc++/functors/slot.h:1774
    #3 0x5555561092f5 in SolveSpace::Platform::GtkEditorOverlay::GtkEditorOverlay(SolveSpace::Platform::Window*) ../src/platform/guigtk.cpp:629
    #4 0x5555561092f5 in SolveSpace::Platform::GtkWindow::GtkWindow(SolveSpace::Platform::Window*) ../src/platform/guigtk.cpp:746
    #5 0x6190003d6d8f  (<unknown module>)

SUMMARY: AddressSanitizer: new-delete-type-mismatch (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xec128) in operator delete(void*, unsigned long)
==4046==HINT: if you don't care about these errors you may set ASAN_OPTIONS=new_delete_type_mismatch=0
=================================================================
==4046==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x608000040620 in thread T0:
  object passed to delete has wrong type:
  size of the allocated type:   88 bytes;
  size of the deallocated type: 48 bytes.
    #0 0x7ffff7283128 in operator delete(void*, unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xec128)
    #1 0x7ffff60d3139 in Glib::SignalProxyConnectionNode::~SignalProxyConnectionNode() ../glibmm/signalproxy_connectionnode.h:39
    #2 0x7ffff60d3139 in Glib::SignalProxyConnectionNode::destroy_notify_handler(void*, _GClosure*) glib/glibmm/signalproxy_connectionnode.cc:96
    #3 0x7ffff60253c3 in closure_invoke_notifiers ../../../gobject/gclosure.c:263
    #4 0x7ffff60253c3 in g_closure_unref ../../../gobject/gclosure.c:615
    #5 0x7ffff60253c3 in g_closure_unref ../../../gobject/gclosure.c:601
    #6 0x7ffff60402e3 in handler_unref_R ../../../gobject/gsignal.c:700
    #7 0x7ffff60402e3 in g_signal_handlers_destroy ../../../gobject/gsignal.c:2714
    #8 0x7ffff602a3ec in g_object_real_dispose ../../../gobject/gobject.c:1054
    #9 0x7ffff602c5f7 in g_object_run_dispose ../../../gobject/gobject.c:1108
    #10 0x7ffff6dd0ec7 in Gtk::Object::_release_c_instance() (/usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1+0x405ec7)
    #11 0x7ffff6d2ecbb in Gtk::GLArea::~GLArea() (/usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1+0x363cbb)
    #12 0x55555610bb59 in SolveSpace::Platform::GtkGLWidget::~GtkGLWidget() ../src/platform/guigtk.cpp:448
    #13 0x55555610bb59 in SolveSpace::Platform::GtkEditorOverlay::~GtkEditorOverlay() ../src/platform/guigtk.cpp:615
    #14 0x55555610bb59 in SolveSpace::Platform::GtkWindow::~GtkWindow() ../src/platform/guigtk.cpp:733
    #15 0x55555610ceba in SolveSpace::Platform::WindowImplGtk::~WindowImplGtk() ../src/platform/guigtk.cpp:853
    #16 0x55555610ceba in void __gnu_cxx::new_allocator<SolveSpace::Platform::WindowImplGtk>::destroy<SolveSpace::Platform::WindowImplGtk>(SolveSpace::Platform::WindowImplGtk*) /usr/include/c++/8/ext/new_allocator.h:140
    #17 0x55555610ceba in void std::allocator_traits<std::allocator<SolveSpace::Platform::WindowImplGtk> >::destroy<SolveSpace::Platform::WindowImplGtk>(std::allocator<SolveSpace::Platform::WindowImplGtk>&, SolveSpace::Platform::WindowImplGtk*) /usr/include/c++/8/bits/alloc_traits.h:487
    #18 0x55555610ceba in std::_Sp_counted_ptr_inplace<SolveSpace::Platform::WindowImplGtk, std::allocator<SolveSpace::Platform::WindowImplGtk>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() /usr/include/c++/8/bits/shared_ptr_base.h:554
    #19 0x555556060b44 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/include/c++/8/bits/shared_ptr_base.h:155
    #20 0x555556060b44 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/include/c++/8/bits/shared_ptr_base.h:148
    #21 0x55555603538f in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/include/c++/8/bits/shared_ptr_base.h:728
    #22 0x55555603538f in std::__shared_ptr<SolveSpace::Platform::Window, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/include/c++/8/bits/shared_ptr_base.h:1167
    #23 0x55555603538f in std::__shared_ptr<SolveSpace::Platform::Window, (__gnu_cxx::_Lock_policy)2>::operator=(std::__shared_ptr<SolveSpace::Platform::Window, (__gnu_cxx::_Lock_policy)2>&&) /usr/include/c++/8/bits/shared_ptr_base.h:1263
    #24 0x55555603538f in std::shared_ptr<SolveSpace::Platform::Window>::operator=(std::shared_ptr<SolveSpace::Platform::Window>&&) /usr/include/c++/8/bits/shared_ptr.h:335
    #25 0x55555603538f in SolveSpace::SolveSpaceUI::Clear() ../src/solvespace.cpp:1023
    #26 0x55555601d587 in main ../src/platform/entrygui.cpp:30
    #27 0x7ffff4b8a09a in __libc_start_main ../csu/libc-start.c:308
    #28 0x55555602d0f9 in _start (/home/ryan/src/third-party/solvespace/build/bin/solvespace+0xad90f9)

0x608000040620 is located 0 bytes inside of 88-byte region [0x608000040620,0x608000040678)
allocated by thread T0 here:
    #0 0x7ffff7281d30 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xead30)
    #1 0x555556109f53 in sigc::slot4<bool, int, int, bool, Glib::RefPtr<Gtk::Tooltip> const&>::slot4<sigc::bound_mem_functor4<bool, SolveSpace::Platform::GtkWindow, int, int, bool, Glib::RefPtr<Gtk::Tooltip> const&> >(sigc::bound_mem_functor4<bool, SolveSpace::Platform::GtkWindow, int, int, bool, Glib::RefPtr<Gtk::Tooltip> const&> const&) /usr/include/sigc++-2.0/sigc++/functors/slot.h:1084
    #2 0x555556109f53 in sigc::slot<bool, int, int, bool, Glib::RefPtr<Gtk::Tooltip> const&, sigc::nil, sigc::nil, sigc::nil>::slot<sigc::bound_mem_functor4<bool, SolveSpace::Platform::GtkWindow, int, int, bool, Glib::RefPtr<Gtk::Tooltip> const&> >(sigc::bound_mem_functor4<bool, SolveSpace::Platform::GtkWindow, int, int, bool, Glib::RefPtr<Gtk::Tooltip> const&> const&) /usr/include/sigc++-2.0/sigc++/functors/slot.h:2050
    #3 0x555556109f53 in SolveSpace::Platform::GtkWindow::GtkWindow(SolveSpace::Platform::Window*) ../src/platform/guigtk.cpp:762
    #4 0x6190003d6d8f  (<unknown module>)

SUMMARY: AddressSanitizer: new-delete-type-mismatch (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xec128) in operator delete(void*, unsigned long)
==4046==HINT: if you don't care about these errors you may set ASAN_OPTIONS=new_delete_type_mismatch=0
=================================================================
==4046==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x6080000376a0 in thread T0:
  object passed to delete has wrong type:
  size of the allocated type:   88 bytes;
  size of the deallocated type: 48 bytes.
    #0 0x7ffff7283128 in operator delete(void*, unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xec128)
    #1 0x7ffff60d3139 in Glib::SignalProxyConnectionNode::~SignalProxyConnectionNode() ../glibmm/signalproxy_connectionnode.h:39
    #2 0x7ffff60d3139 in Glib::SignalProxyConnectionNode::destroy_notify_handler(void*, _GClosure*) glib/glibmm/signalproxy_connectionnode.cc:96
    #3 0x7ffff60253c3 in closure_invoke_notifiers ../../../gobject/gclosure.c:263
    #4 0x7ffff60253c3 in g_closure_unref ../../../gobject/gclosure.c:615
    #5 0x7ffff60253c3 in g_closure_unref ../../../gobject/gclosure.c:601
    #6 0x7ffff60402e3 in handler_unref_R ../../../gobject/gsignal.c:700
    #7 0x7ffff60402e3 in g_signal_handlers_destroy ../../../gobject/gsignal.c:2714
    #8 0x7ffff602a3ec in g_object_real_dispose ../../../gobject/gobject.c:1054
    #9 0x7ffff602c5f7 in g_object_run_dispose ../../../gobject/gobject.c:1108
    #10 0x7ffff6dd0ec7 in Gtk::Object::_release_c_instance() (/usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1+0x405ec7)
    #11 0x7ffff6d4415b in Gtk::MenuBar::~MenuBar() (/usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1+0x37915b)
    #12 0x55555610d7a0 in SolveSpace::Platform::MenuBarImplGtk::~MenuBarImplGtk() ../src/platform/guigtk.cpp:414
    #13 0x55555610d7a0 in void __gnu_cxx::new_allocator<SolveSpace::Platform::MenuBarImplGtk>::destroy<SolveSpace::Platform::MenuBarImplGtk>(SolveSpace::Platform::MenuBarImplGtk*) /usr/include/c++/8/ext/new_allocator.h:140
    #14 0x55555610d7a0 in void std::allocator_traits<std::allocator<SolveSpace::Platform::MenuBarImplGtk> >::destroy<SolveSpace::Platform::MenuBarImplGtk>(std::allocator<SolveSpace::Platform::MenuBarImplGtk>&, SolveSpace::Platform::MenuBarImplGtk*) /usr/include/c++/8/bits/alloc_traits.h:487
    #15 0x55555610d7a0 in std::_Sp_counted_ptr_inplace<SolveSpace::Platform::MenuBarImplGtk, std::allocator<SolveSpace::Platform::MenuBarImplGtk>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() /usr/include/c++/8/bits/shared_ptr_base.h:554
    #16 0x555556060b44 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/include/c++/8/bits/shared_ptr_base.h:155
    #17 0x555556060b44 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/include/c++/8/bits/shared_ptr_base.h:148
    #18 0x55555610cea4 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/include/c++/8/bits/shared_ptr_base.h:728
    #19 0x55555610cea4 in std::__shared_ptr<SolveSpace::Platform::MenuBar, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/include/c++/8/bits/shared_ptr_base.h:1167
    #20 0x55555610cea4 in std::shared_ptr<SolveSpace::Platform::MenuBar>::~shared_ptr() /usr/include/c++/8/bits/shared_ptr.h:103
    #21 0x55555610cea4 in SolveSpace::Platform::WindowImplGtk::~WindowImplGtk() ../src/platform/guigtk.cpp:853
    #22 0x55555610cea4 in void __gnu_cxx::new_allocator<SolveSpace::Platform::WindowImplGtk>::destroy<SolveSpace::Platform::WindowImplGtk>(SolveSpace::Platform::WindowImplGtk*) /usr/include/c++/8/ext/new_allocator.h:140
    #23 0x55555610cea4 in void std::allocator_traits<std::allocator<SolveSpace::Platform::WindowImplGtk> >::destroy<SolveSpace::Platform::WindowImplGtk>(std::allocator<SolveSpace::Platform::WindowImplGtk>&, SolveSpace::Platform::WindowImplGtk*) /usr/include/c++/8/bits/alloc_traits.h:487
    #24 0x55555610cea4 in std::_Sp_counted_ptr_inplace<SolveSpace::Platform::WindowImplGtk, std::allocator<SolveSpace::Platform::WindowImplGtk>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() /usr/include/c++/8/bits/shared_ptr_base.h:554
    #25 0x555556060b44 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/include/c++/8/bits/shared_ptr_base.h:155
    #26 0x555556060b44 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/include/c++/8/bits/shared_ptr_base.h:148
    #27 0x555556037573 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/include/c++/8/bits/shared_ptr_base.h:728
    #28 0x555556037573 in std::__shared_ptr<SolveSpace::Platform::Window, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/include/c++/8/bits/shared_ptr_base.h:1167
    #29 0x555556037573 in std::__shared_ptr<SolveSpace::Platform::Window, (__gnu_cxx::_Lock_policy)2>::operator=(std::__shared_ptr<SolveSpace::Platform::Window, (__gnu_cxx::_Lock_policy)2>&&) /usr/include/c++/8/bits/shared_ptr_base.h:1263
    #30 0x555556037573 in std::shared_ptr<SolveSpace::Platform::Window>::operator=(std::shared_ptr<SolveSpace::Platform::Window>&&) /usr/include/c++/8/bits/shared_ptr.h:335
    #31 0x555556037573 in SolveSpace::SolveSpaceUI::Clear() ../src/solvespace.cpp:1039
    #32 0x55555601d587 in main ../src/platform/entrygui.cpp:30
    #33 0x7ffff4b8a09a in __libc_start_main ../csu/libc-start.c:308
    #34 0x55555602d0f9 in _start (/home/ryan/src/third-party/solvespace/build/bin/solvespace+0xad90f9)

0x6080000376a0 is located 0 bytes inside of 88-byte region [0x6080000376a0,0x6080000376f8)
allocated by thread T0 here:
    #0 0x7ffff7281d30 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xead30)
    #1 0x7ffff6d4458b in Gtk::MenuBar::MenuBar() (/usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1+0x37958b)

SUMMARY: AddressSanitizer: new-delete-type-mismatch (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xec128) in operator delete(void*, unsigned long)
==4046==HINT: if you don't care about these errors you may set ASAN_OPTIONS=new_delete_type_mismatch=0
=================================================================
==4046==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x6080000372a0 in thread T0:
  object passed to delete has wrong type:
  size of the allocated type:   88 bytes;
  size of the deallocated type: 48 bytes.
    #0 0x7ffff7283128 in operator delete(void*, unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xec128)
    #1 0x7ffff60d3139 in Glib::SignalProxyConnectionNode::~SignalProxyConnectionNode() ../glibmm/signalproxy_connectionnode.h:39
    #2 0x7ffff60d3139 in Glib::SignalProxyConnectionNode::destroy_notify_handler(void*, _GClosure*) glib/glibmm/signalproxy_connectionnode.cc:96
    #3 0x7ffff60253c3 in closure_invoke_notifiers ../../../gobject/gclosure.c:263
    #4 0x7ffff60253c3 in g_closure_unref ../../../gobject/gclosure.c:615
    #5 0x7ffff60253c3 in g_closure_unref ../../../gobject/gclosure.c:601
    #6 0x7ffff60402e3 in handler_unref_R ../../../gobject/gsignal.c:700
    #7 0x7ffff60402e3 in g_signal_handlers_destroy ../../../gobject/gsignal.c:2714
    #8 0x7ffff602a3ec in g_object_real_dispose ../../../gobject/gobject.c:1054
    #9 0x7ffff602adb2 in g_object_unref ../../../gobject/gobject.c:3309
    #10 0x7ffff602adb2 in g_object_unref ../../../gobject/gobject.c:3238
    #11 0x7ffff64c2340 in gtk_range_destroy ../../../../gtk/gtkrange.c:1781
    #12 0x7ffff6025c8c in g_closure_invoke ../../../gobject/gclosure.c:810
    #13 0x7ffff6039675 in signal_emit_unlocked_R ../../../gobject/gsignal.c:3751
    #14 0x7ffff60422bd in g_signal_emit_valist ../../../gobject/gsignal.c:3391
    #15 0x7ffff604297e in g_signal_emit ../../../gobject/gsignal.c:3447
    #16 0x7ffff65ac30b in gtk_widget_dispose ../../../../gtk/gtkwidget.c:12098
    #17 0x7ffff602c5f7 in g_object_run_dispose ../../../gobject/gobject.c:1108
    #18 0x7ffff6dd0ec7 in Gtk::Object::_release_c_instance() (/usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1+0x405ec7)
    #19 0x7ffff6dbf266 in Gtk::VScrollbar::~VScrollbar() (/usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1+0x3f4266)
    #20 0x55555610b99a in SolveSpace::Platform::GtkWindow::~GtkWindow() ../src/platform/guigtk.cpp:733
    #21 0x55555610ceba in SolveSpace::Platform::WindowImplGtk::~WindowImplGtk() ../src/platform/guigtk.cpp:853
    #22 0x55555610ceba in void __gnu_cxx::new_allocator<SolveSpace::Platform::WindowImplGtk>::destroy<SolveSpace::Platform::WindowImplGtk>(SolveSpace::Platform::WindowImplGtk*) /usr/include/c++/8/ext/new_allocator.h:140
    #23 0x55555610ceba in void std::allocator_traits<std::allocator<SolveSpace::Platform::WindowImplGtk> >::destroy<SolveSpace::Platform::WindowImplGtk>(std::allocator<SolveSpace::Platform::WindowImplGtk>&, SolveSpace::Platform::WindowImplGtk*) /usr/include/c++/8/bits/alloc_traits.h:487
    #24 0x55555610ceba in std::_Sp_counted_ptr_inplace<SolveSpace::Platform::WindowImplGtk, std::allocator<SolveSpace::Platform::WindowImplGtk>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() /usr/include/c++/8/bits/shared_ptr_base.h:554
    #25 0x555556060b44 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/include/c++/8/bits/shared_ptr_base.h:155
    #26 0x555556060b44 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/include/c++/8/bits/shared_ptr_base.h:148
    #27 0x555556037573 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/include/c++/8/bits/shared_ptr_base.h:728
    #28 0x555556037573 in std::__shared_ptr<SolveSpace::Platform::Window, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/include/c++/8/bits/shared_ptr_base.h:1167
    #29 0x555556037573 in std::__shared_ptr<SolveSpace::Platform::Window, (__gnu_cxx::_Lock_policy)2>::operator=(std::__shared_ptr<SolveSpace::Platform::Window, (__gnu_cxx::_Lock_policy)2>&&) /usr/include/c++/8/bits/shared_ptr_base.h:1263
    #30 0x555556037573 in std::shared_ptr<SolveSpace::Platform::Window>::operator=(std::shared_ptr<SolveSpace::Platform::Window>&&) /usr/include/c++/8/bits/shared_ptr.h:335
    #31 0x555556037573 in SolveSpace::SolveSpaceUI::Clear() ../src/solvespace.cpp:1039
    #32 0x55555601d587 in main ../src/platform/entrygui.cpp:30
    #33 0x7ffff4b8a09a in __libc_start_main ../csu/libc-start.c:308
    #34 0x55555602d0f9 in _start (/home/ryan/src/third-party/solvespace/build/bin/solvespace+0xad90f9)

0x6080000372a0 is located 0 bytes inside of 88-byte region [0x6080000372a0,0x6080000372f8)
allocated by thread T0 here:
    #0 0x7ffff7281d30 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xead30)
    #1 0x5555561099e8 in sigc::slot0<void>::slot0<sigc::bound_mem_functor0<void, SolveSpace::Platform::GtkWindow> >(sigc::bound_mem_functor0<void, SolveSpace::Platform::GtkWindow> const&) /usr/include/sigc++-2.0/sigc++/functors/slot.h:546
    #2 0x5555561099e8 in sigc::slot<void, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil>::slot<sigc::bound_mem_functor0<void, SolveSpace::Platform::GtkWindow> >(sigc::bound_mem_functor0<void, SolveSpace::Platform::GtkWindow> const&) /usr/include/sigc++-2.0/sigc++/functors/slot.h:1774
    #3 0x5555561099e8 in SolveSpace::Platform::GtkWindow::GtkWindow(SolveSpace::Platform::Window*) ../src/platform/guigtk.cpp:758
    #4 0x61900037ff8f  (<unknown module>)

SUMMARY: AddressSanitizer: new-delete-type-mismatch (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xec128) in operator delete(void*, unsigned long)
==4046==HINT: if you don't care about these errors you may set ASAN_OPTIONS=new_delete_type_mismatch=0
=================================================================
==4046==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x6080000363a0 in thread T0:
  object passed to delete has wrong type:
  size of the allocated type:   88 bytes;
  size of the deallocated type: 48 bytes.
    #0 0x7ffff7283128 in operator delete(void*, unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xec128)
    #1 0x7ffff60d3139 in Glib::SignalProxyConnectionNode::~SignalProxyConnectionNode() ../glibmm/signalproxy_connectionnode.h:39
    #2 0x7ffff60d3139 in Glib::SignalProxyConnectionNode::destroy_notify_handler(void*, _GClosure*) glib/glibmm/signalproxy_connectionnode.cc:96
    #3 0x7ffff60253c3 in closure_invoke_notifiers ../../../gobject/gclosure.c:263
    #4 0x7ffff60253c3 in g_closure_unref ../../../gobject/gclosure.c:615
    #5 0x7ffff60253c3 in g_closure_unref ../../../gobject/gclosure.c:601
    #6 0x7ffff60402e3 in handler_unref_R ../../../gobject/gsignal.c:700
    #7 0x7ffff60402e3 in g_signal_handlers_destroy ../../../gobject/gsignal.c:2714
    #8 0x7ffff602a3ec in g_object_real_dispose ../../../gobject/gobject.c:1054
    #9 0x7ffff602c5f7 in g_object_run_dispose ../../../gobject/gobject.c:1108
    #10 0x7ffff6dd0ec7 in Gtk::Object::_release_c_instance() (/usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1+0x405ec7)
    #11 0x7ffff6d14cc1 in Gtk::Entry::~Entry() (/usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1+0x349cc1)
    #12 0x55555610ba83 in SolveSpace::Platform::GtkEditorOverlay::~GtkEditorOverlay() ../src/platform/guigtk.cpp:615
    #13 0x55555610ba83 in SolveSpace::Platform::GtkWindow::~GtkWindow() ../src/platform/guigtk.cpp:733
    #14 0x55555610ceba in SolveSpace::Platform::WindowImplGtk::~WindowImplGtk() ../src/platform/guigtk.cpp:853
    #15 0x55555610ceba in void __gnu_cxx::new_allocator<SolveSpace::Platform::WindowImplGtk>::destroy<SolveSpace::Platform::WindowImplGtk>(SolveSpace::Platform::WindowImplGtk*) /usr/include/c++/8/ext/new_allocator.h:140
    #16 0x55555610ceba in void std::allocator_traits<std::allocator<SolveSpace::Platform::WindowImplGtk> >::destroy<SolveSpace::Platform::WindowImplGtk>(std::allocator<SolveSpace::Platform::WindowImplGtk>&, SolveSpace::Platform::WindowImplGtk*) /usr/include/c++/8/bits/alloc_traits.h:487
    #17 0x55555610ceba in std::_Sp_counted_ptr_inplace<SolveSpace::Platform::WindowImplGtk, std::allocator<SolveSpace::Platform::WindowImplGtk>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() /usr/include/c++/8/bits/shared_ptr_base.h:554
    #18 0x555556060b44 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/include/c++/8/bits/shared_ptr_base.h:155
    #19 0x555556060b44 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/include/c++/8/bits/shared_ptr_base.h:148
    #20 0x555556037573 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/include/c++/8/bits/shared_ptr_base.h:728
    #21 0x555556037573 in std::__shared_ptr<SolveSpace::Platform::Window, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/include/c++/8/bits/shared_ptr_base.h:1167
    #22 0x555556037573 in std::__shared_ptr<SolveSpace::Platform::Window, (__gnu_cxx::_Lock_policy)2>::operator=(std::__shared_ptr<SolveSpace::Platform::Window, (__gnu_cxx::_Lock_policy)2>&&) /usr/include/c++/8/bits/shared_ptr_base.h:1263
    #23 0x555556037573 in std::shared_ptr<SolveSpace::Platform::Window>::operator=(std::shared_ptr<SolveSpace::Platform::Window>&&) /usr/include/c++/8/bits/shared_ptr.h:335
    #24 0x555556037573 in SolveSpace::SolveSpaceUI::Clear() ../src/solvespace.cpp:1039
    #25 0x55555601d587 in main ../src/platform/entrygui.cpp:30
    #26 0x7ffff4b8a09a in __libc_start_main ../csu/libc-start.c:308
    #27 0x55555602d0f9 in _start (/home/ryan/src/third-party/solvespace/build/bin/solvespace+0xad90f9)

0x6080000363a0 is located 0 bytes inside of 88-byte region [0x6080000363a0,0x6080000363f8)
allocated by thread T0 here:
    #0 0x7ffff7281d30 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xead30)
    #1 0x5555561092f5 in sigc::slot0<void>::slot0<sigc::bound_mem_functor0<void, SolveSpace::Platform::GtkEditorOverlay> >(sigc::bound_mem_functor0<void, SolveSpace::Platform::GtkEditorOverlay> const&) /usr/include/sigc++-2.0/sigc++/functors/slot.h:546
    #2 0x5555561092f5 in sigc::slot<void, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil>::slot<sigc::bound_mem_functor0<void, SolveSpace::Platform::GtkEditorOverlay> >(sigc::bound_mem_functor0<void, SolveSpace::Platform::GtkEditorOverlay> const&) /usr/include/sigc++-2.0/sigc++/functors/slot.h:1774
    #3 0x5555561092f5 in SolveSpace::Platform::GtkEditorOverlay::GtkEditorOverlay(SolveSpace::Platform::Window*) ../src/platform/guigtk.cpp:629
    #4 0x5555561092f5 in SolveSpace::Platform::GtkWindow::GtkWindow(SolveSpace::Platform::Window*) ../src/platform/guigtk.cpp:746
    #5 0x61900037ff8f  (<unknown module>)

SUMMARY: AddressSanitizer: new-delete-type-mismatch (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xec128) in operator delete(void*, unsigned long)
==4046==HINT: if you don't care about these errors you may set ASAN_OPTIONS=new_delete_type_mismatch=0
=================================================================
==4046==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x608000037320 in thread T0:
  object passed to delete has wrong type:
  size of the allocated type:   88 bytes;
  size of the deallocated type: 48 bytes.
    #0 0x7ffff7283128 in operator delete(void*, unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xec128)
    #1 0x7ffff60d3139 in Glib::SignalProxyConnectionNode::~SignalProxyConnectionNode() ../glibmm/signalproxy_connectionnode.h:39
    #2 0x7ffff60d3139 in Glib::SignalProxyConnectionNode::destroy_notify_handler(void*, _GClosure*) glib/glibmm/signalproxy_connectionnode.cc:96
    #3 0x7ffff60253c3 in closure_invoke_notifiers ../../../gobject/gclosure.c:263
    #4 0x7ffff60253c3 in g_closure_unref ../../../gobject/gclosure.c:615
    #5 0x7ffff60253c3 in g_closure_unref ../../../gobject/gclosure.c:601
    #6 0x7ffff60402e3 in handler_unref_R ../../../gobject/gsignal.c:700
    #7 0x7ffff60402e3 in g_signal_handlers_destroy ../../../gobject/gsignal.c:2714
    #8 0x7ffff602a3ec in g_object_real_dispose ../../../gobject/gobject.c:1054
    #9 0x7ffff602c5f7 in g_object_run_dispose ../../../gobject/gobject.c:1108
    #10 0x7ffff6dd0ec7 in Gtk::Object::_release_c_instance() (/usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1+0x405ec7)
    #11 0x7ffff6d2ecbb in Gtk::GLArea::~GLArea() (/usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1+0x363cbb)
    #12 0x55555610bb59 in SolveSpace::Platform::GtkGLWidget::~GtkGLWidget() ../src/platform/guigtk.cpp:448
    #13 0x55555610bb59 in SolveSpace::Platform::GtkEditorOverlay::~GtkEditorOverlay() ../src/platform/guigtk.cpp:615
    #14 0x55555610bb59 in SolveSpace::Platform::GtkWindow::~GtkWindow() ../src/platform/guigtk.cpp:733
    #15 0x55555610ceba in SolveSpace::Platform::WindowImplGtk::~WindowImplGtk() ../src/platform/guigtk.cpp:853
    #16 0x55555610ceba in void __gnu_cxx::new_allocator<SolveSpace::Platform::WindowImplGtk>::destroy<SolveSpace::Platform::WindowImplGtk>(SolveSpace::Platform::WindowImplGtk*) /usr/include/c++/8/ext/new_allocator.h:140
    #17 0x55555610ceba in void std::allocator_traits<std::allocator<SolveSpace::Platform::WindowImplGtk> >::destroy<SolveSpace::Platform::WindowImplGtk>(std::allocator<SolveSpace::Platform::WindowImplGtk>&, SolveSpace::Platform::WindowImplGtk*) /usr/include/c++/8/bits/alloc_traits.h:487
    #18 0x55555610ceba in std::_Sp_counted_ptr_inplace<SolveSpace::Platform::WindowImplGtk, std::allocator<SolveSpace::Platform::WindowImplGtk>, (__gnu_cxx::_Lock_policy)2>::_M_dispose() /usr/include/c++/8/bits/shared_ptr_base.h:554
    #19 0x555556060b44 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/include/c++/8/bits/shared_ptr_base.h:155
    #20 0x555556060b44 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/include/c++/8/bits/shared_ptr_base.h:148
    #21 0x555556037573 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/include/c++/8/bits/shared_ptr_base.h:728
    #22 0x555556037573 in std::__shared_ptr<SolveSpace::Platform::Window, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/include/c++/8/bits/shared_ptr_base.h:1167
    #23 0x555556037573 in std::__shared_ptr<SolveSpace::Platform::Window, (__gnu_cxx::_Lock_policy)2>::operator=(std::__shared_ptr<SolveSpace::Platform::Window, (__gnu_cxx::_Lock_policy)2>&&) /usr/include/c++/8/bits/shared_ptr_base.h:1263
    #24 0x555556037573 in std::shared_ptr<SolveSpace::Platform::Window>::operator=(std::shared_ptr<SolveSpace::Platform::Window>&&) /usr/include/c++/8/bits/shared_ptr.h:335
    #25 0x555556037573 in SolveSpace::SolveSpaceUI::Clear() ../src/solvespace.cpp:1039
    #26 0x55555601d587 in main ../src/platform/entrygui.cpp:30
    #27 0x7ffff4b8a09a in __libc_start_main ../csu/libc-start.c:308
    #28 0x55555602d0f9 in _start (/home/ryan/src/third-party/solvespace/build/bin/solvespace+0xad90f9)

0x608000037320 is located 0 bytes inside of 88-byte region [0x608000037320,0x608000037378)
allocated by thread T0 here:
    #0 0x7ffff7281d30 in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xead30)
    #1 0x555556109f53 in sigc::slot4<bool, int, int, bool, Glib::RefPtr<Gtk::Tooltip> const&>::slot4<sigc::bound_mem_functor4<bool, SolveSpace::Platform::GtkWindow, int, int, bool, Glib::RefPtr<Gtk::Tooltip> const&> >(sigc::bound_mem_functor4<bool, SolveSpace::Platform::GtkWindow, int, int, bool, Glib::RefPtr<Gtk::Tooltip> const&> const&) /usr/include/sigc++-2.0/sigc++/functors/slot.h:1084
    #2 0x555556109f53 in sigc::slot<bool, int, int, bool, Glib::RefPtr<Gtk::Tooltip> const&, sigc::nil, sigc::nil, sigc::nil>::slot<sigc::bound_mem_functor4<bool, SolveSpace::Platform::GtkWindow, int, int, bool, Glib::RefPtr<Gtk::Tooltip> const&> >(sigc::bound_mem_functor4<bool, SolveSpace::Platform::GtkWindow, int, int, bool, Glib::RefPtr<Gtk::Tooltip> const&> const&) /usr/include/sigc++-2.0/sigc++/functors/slot.h:2050
    #3 0x555556109f53 in SolveSpace::Platform::GtkWindow::GtkWindow(SolveSpace::Platform::Window*) ../src/platform/guigtk.cpp:762
    #4 0x61900037ff8f  (<unknown module>)

SUMMARY: AddressSanitizer: new-delete-type-mismatch (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xec128) in operator delete(void*, unsigned long)
robnee commented 3 years ago

@rpavlik I wonder if we need to explicitly destroy or stop the timers when tearing down the app or when there is no geometry to display? Maybe they are firing when we don't want them to. I know for sure they don't always fire in a predictable order.

rpavlik commented 3 years ago

Well, at least some of those mismatched new delete warnings about timers are false positives: shortly after I posted my last comment here, I found another bug report with a similar message and info on the root cause, so you'll notice there is now a comment on the relevant line of SolveSpace explaining it with a link to upstream 😁

It's possible there's a lifetime management thing going on here, but I wouldn't assume there is just based on my sanitizer results above.

ghost commented 3 years ago

I just reinstalled system with MX Linux MX-19.4 distro — on "clean install" SolveSpace 3.0~https://github.com/solvespace/solvespace/commit/33091817738d780d904bcd3e077022d87ebf2cd3 can opens testcase file without Segmentation fault.

  1. Launch SolveSpace;
  2. Open testcase file via "File > Open ...";
  3. Close SolveSpace via "File > Exit".

Terminal log of session

$ solvespace
SolveSpace!

json_object_from_file: error opening file /home/user/.config/solvespace/settings.json: No such file or directory

(solvespace:8064): Gtk-WARNING **: 21:45:58.476: gtk_window_present_with_time() should not be called with 0, or GDK_CURRENT_TIME as a timestamp, the timestamp should instead be gathered at the time the user initiated the request for the window to be shown
Generate::REGEN (for bounding box) took 107 ms
Generate::REGEN took 232 ms
Generate::ALL (for bounding box) took 121 ms
bad, edge_inters=4
bad, edge_inters=4
bad, edge_inters=4
bad, edge_inters=4
bad, edge_inters=4
bad, edge_inters=4
Generate::ALL took 353 ms
Generate::DIRTY (for bounding box) took 82 ms
bad, edge_inters=4
bad, edge_inters=4
bad, edge_inters=4
bad, edge_inters=4
Generate::DIRTY took 198 ms
Generate::DIRTY (for bounding box) took 88 ms
Generate::DIRTY took 172 ms
$

@robnee @rpavlik, Does it looks OK?

robnee commented 3 years ago

The messages look fine. I would say if this file no longer seg faults then this issue can be closed. I don't think anyone one else was able to reproduce.

rpavlik commented 3 years ago

yep, that's all good. Thanks for bearing with us as we dug into this one.