*if* you can make it happen under Valgrind, that would probably the the
fastest way to pinpoint it. Of course, running under valgrind >does slow operation down significantly...
Otherwise if it is a double-free issue, you can often spot it by ensuring
members are set to 0 after deleting. That will shift things to a null->pointer dereference which is a much more immediate crash and easily visible dump.
I think when toggling, the currently active tool simply deletes itself... Now I just have to figure out why this works in trunk. Regards, Markus
==4489== Invalid read of size 8 ==4489== at 0x4C5998: sp_event_context_virtual_root_handler(SPEventContext*, _GdkEvent*) (event-context.cpp:1092) ==4489== by 0x49778B: sp_desktop_root_handler(SPCanvasItem*, _GdkEvent*, SPDesktop*) (desktop-events.cpp:77) ==4489== by 0x6D3020: sp_marshal_BOOLEAN__POINTER (sp-marshal.cpp:124) ==4489== by 0x874A13F: g_closure_invoke (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3400.1) ==4489== by 0x875B54F: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3400.1) ==4489== by 0x87630CA: g_signal_emit_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3400.1) ==4489== by 0x8763641: g_signal_emit (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3400.1) ==4489== by 0x66F087: SPCanvasImpl::emitEvent(SPCanvas*, _GdkEvent*) (sp-canvas.cpp:1591) ==4489== by 0x5C84598: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.13) ==4489== by 0x874A07D: g_closure_invoke (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3400.1) ==4489== by 0x875B2CF: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3400.1) ==4489== by 0x87630CA: g_signal_emit_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3400.1) ==4489== Address 0x1d1849e8 is 8 bytes inside a block of size 176 free'd ==4489== at 0x4C2A44B: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==4489== by 0x4922CB: SPDesktop::set_event_context2(std::string const&) (desktop.cpp:693) ==4489== by 0x60544B: tools_switch(SPDesktop*, int) (tools-switch.cpp:125) ==4489== by 0x4C78EA: SPEventContext::root_handler(_GdkEvent*) (event-context.cpp:310) ==4489== by 0x547F51: SPRectContext::root_handler(_GdkEvent*) (rect-context.cpp:383) ==4489== by 0x4C5990: sp_event_context_virtual_root_handler(SPEventContext*, _GdkEvent*) (event-context.cpp:1090) ==4489== by 0x49778B: sp_desktop_root_handler(SPCanvasItem*, _GdkEvent*, SPDesktop*) (desktop-events.cpp:77) ==4489== by 0x6D3020: sp_marshal_BOOLEAN__POINTER (sp-marshal.cpp:124) ==4489== by 0x874A13F: g_closure_invoke (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3400.1) ==4489== by 0x875B54F: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3400.1) ==4489== by 0x87630CA: g_signal_emit_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3400.1) ==4489== by 0x8763641: g_signal_emit (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3400.1) ==4489== ==4489== Invalid write of size 1 ==4489== at 0x4C70BF: SPEventContext::root_handler(_GdkEvent*) (event-context.cpp:760) ==4489== by 0x54ECB6: SPSelectContext::root_handler(_GdkEvent*) (select-context.cpp:1224) ==4489== by 0x4C5990: sp_event_context_virtual_root_handler(SPEventContext*, _GdkEvent*) (event-context.cpp:1090) ==4489== by 0x49778B: sp_desktop_root_handler(SPCanvasItem*, _GdkEvent*, SPDesktop*) (desktop-events.cpp:77) ==4489== by 0x6D3020: sp_marshal_BOOLEAN__POINTER (sp-marshal.cpp:124) ==4489== by 0x874A13F: g_closure_invoke (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3400.1) ==4489== by 0x875B54F: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3400.1) ==4489== by 0x87630CA: g_signal_emit_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3400.1) ==4489== by 0x8763641: g_signal_emit (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3400.1) ==4489== by 0x66F087: SPCanvasImpl::emitEvent(SPCanvas*, _GdkEvent*) (sp-canvas.cpp:1591) ==4489== by 0x5C84598: ??? (in /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0.2400.13) ==4489== by 0x874A07D: g_closure_invoke (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3400.1) ==4489== Address 0x1fcd4acc is 60 bytes inside a block of size 200 free'd ==4489== at 0x4C2A44B: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==4489== by 0x4922CB: SPDesktop::set_event_context2(std::string const&) (desktop.cpp:693) ==4489== by 0x60544B: tools_switch(SPDesktop*, int) (tools-switch.cpp:125) ==4489== by 0x4C75BB: SPEventContext::root_handler(_GdkEvent*) (event-context.cpp:303) ==4489== by 0x54ECB6: SPSelectContext::root_handler(_GdkEvent*) (select-context.cpp:1224) ==4489== by 0x4C5990: sp_event_context_virtual_root_handler(SPEventContext*, _GdkEvent*) (event-context.cpp:1090) ==4489== by 0x49778B: sp_desktop_root_handler(SPCanvasItem*, _GdkEvent*, SPDesktop*) (desktop-events.cpp:77) ==4489== by 0x6D3020: sp_marshal_BOOLEAN__POINTER (sp-marshal.cpp:124) ==4489== by 0x874A13F: g_closure_invoke (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3400.1) ==4489== by 0x875B54F: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3400.1) ==4489== by 0x87630CA: g_signal_emit_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3400.1) ==4489== by 0x8763641: g_signal_emit (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3400.1) ==4489==