
On 2013-08-02 15:34 +0200, Markus Engel wrote:
I can press space a hundred times, no matter whether fast or slowly, it won't crash :( . Does that happen with "D", too? Or with other tools?
So far, only the crash with the text tool can be reproduced consistently (after 4 or at most ~8 times tapping the space bar).
However, with some patience I'm able to make your branch crash when tool-switching with other tools as well:
Similar crash e.g. with the node tool:
Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x0000000040996cf0 0x0000000100a21478 in Inkscape::UI::TransformHandleSet::~TransformHandleSet (this=0x1409ab8f0) at ../../src/ui/tool/transform-handle-set.cpp:708 708 delete _handles[i]; (gdb) bt #0 0x0000000100a21478 in Inkscape::UI::TransformHandleSet::~TransformHandleSet (this=0x1409ab8f0) at ../../src/ui/tool/transform-handle-set.cpp:708 #1 0x0000000100a21415 in Inkscape::UI::TransformHandleSet::~TransformHandleSet (this=0x1409ab8f0) at ../../src/ui/tool/transform-handle-set.cpp:706 #2 0x0000000100a213b8 in Inkscape::UI::TransformHandleSet::~TransformHandleSet (this=0x1409ab8f0) at ../../src/ui/tool/transform-handle-set.cpp:706 #3 0x00000001009dcfe3 in Inkscape::UI::ControlPointSelection::~ControlPointSelection (this=0x14099cff0) at ../../src/ui/tool/control-point-selection.cpp:73 #4 0x00000001009dcf85 in Inkscape::UI::ControlPointSelection::~ControlPointSelection (this=0x14099cff0) at ../../src/ui/tool/control-point-selection.cpp:71 #5 0x00000001009dcf28 in Inkscape::UI::ControlPointSelection::~ControlPointSelection (this=0x14099cff0) at ../../src/ui/tool/control-point-selection.cpp:71 #6 0x0000000100a01356 in InkNodeTool::~InkNodeTool (this=0x10d569ca0) at ../../src/ui/tool/node-tool.cpp:175 #7 0x0000000100a01235 in InkNodeTool::~InkNodeTool (this=0x10d569ca0) at ../../src/ui/tool/node-tool.cpp:162 #8 0x0000000100a011d8 in InkNodeTool::~InkNodeTool (this=0x10d569ca0) at ../../src/ui/tool/node-tool.cpp:162 #9 0x000000010005abca in SPDesktop::set_event_context2 (this=0x10ad8fc00, toolName=@0x7fff5fbfdfb8) at ../../src/desktop.cpp:679 #10 0x00000001003599d4 in tools_switch (dt=0x10ad8fc00, num=1) at ../../src/tools-switch.cpp:125 #11 0x00000001000cb785 in sp_toggle_selector (dt=0x10ad8fc00) at ../../src/event-context.cpp:308 #12 0x00000001000cad89 in SPEventContext::root_handler (this=0x10d569ca0, event=0x1091c3d60) at ../../src/event-context.cpp:754 #13 0x0000000100a0440a in InkNodeTool::root_handler (this=0x10d569ca0, event=0x1091c3d60) at ../../src/ui/tool/node-tool.cpp:539 #14 0x00000001000ccce9 in sp_event_context_virtual_root_handler (event_context=0x10d569ca0, event=0x1091c3d60) at ../../src/event-context.cpp:1088 #15 0x00000001000cbd52 in sp_event_context_root_handler (event_context=0x10d569ca0, event=0x1091c3d60) at ../../src/event-context.cpp:1080 #16 0x000000010006d666 in sp_desktop_root_handler (event=0x1091c3d60, desktop=0x10ad8fc00) at ../../src/desktop-events.cpp:77 #17 0x00000001006456bf in sp_desktop_widget_event (widget=0x1082d3050, event=0x1091c3d60, dtw=0x1082b6030) at ../../src/widgets/desktop-widget.cpp:1013 #18 0x0000000103566fcf in _gtk_marshal_BOOLEAN__BOXED (closure=<value temporarily unavailable, due to optimizations>, return_value=0x7fff5fbfe958, n_param_values=<value temporarily unavailable, due to optimizations>, param_values=0x7fff5fbfea00, invocation_hint=<value temporarily unavailable, due to optimizations>, marshal_data=<value temporarily unavailable, due to optimizations>) at gtkmarshalers.c:86 #19 0x0000000106e3dbc4 in g_closure_invoke () #20 0x0000000106e4d5f9 in signal_emit_unlocked_R () #21 0x0000000106e4e7f8 in g_signal_emit_valist () #22 0x0000000106e4ed24 in g_signal_emit () #23 0x000000010367c08a in gtk_widget_event_internal (widget=0x1082d3050, event=0x1091c3d60) at gtkwidget.c:4905 #24 0x000000010368cc1a in gtk_window_propagate_key_event (window=0x1216d4e30, event=0x1091c3d60) at gtkwindow.c:5199 #25 0x0000000103690b48 in gtk_window_key_release_event (widget=0x1216d4e30, event=0x1091c3d60) at gtkwindow.c:5247 #26 0x0000000103566fcf in _gtk_marshal_BOOLEAN__BOXED (closure=<value temporarily unavailable, due to optimizations>, return_value=0x7fff5fbfeec8, n_param_values=<value temporarily unavailable, due to optimizations>, param_values=0x7fff5fbfef70, invocation_hint=<value temporarily unavailable, due to optimizations>, marshal_data=<value temporarily unavailable, due to optimizations>) at gtkmarshalers.c:86 #27 0x0000000106e3dbc4 in g_closure_invoke () #28 0x0000000106e4d83a in signal_emit_unlocked_R () #29 0x0000000106e4e7f8 in g_signal_emit_valist () #30 0x0000000106e4ed24 in g_signal_emit () #31 0x000000010367c24c in gtk_widget_event_internal (widget=0x1216d4e30, event=0x1091c3d60) at gtkwidget.c:5010 #32 0x0000000103565027 in gtk_propagate_event (widget=0x1216d4e30, event=<value temporarily unavailable, due to optimizations>) at gtkmain.c:2464 #33 0x0000000103564cce in gtk_main_do_event (event=<value temporarily unavailable, due to optimizations>) at gtkmain.c:1646 #34 0x0000000100005114 in snooper (event=0x1091c3d60) at ../../src/main.cpp:996 #35 0x0000000103a2f40a in gdk_event_dispatch (source=0x1091c3d60, callback=0, user_data=0x7625cf000000000) at gdkeventloop-quartz.c:677 #36 0x0000000106ec6838 in g_main_context_dispatch () #37 0x0000000106ec894e in g_main_context_iterate () #38 0x0000000106ec9eef in g_main_loop_run () #39 0x00000001035644f1 in gtk_main () at gtkmain.c:1257 #40 0x0000000100004864 in sp_main_gui (argc=1, argv=0x7fff5fbff788) at ../../src/main.cpp:1062 #41 0x000000010000405f in main (argc=1, argv=0x7fff5fbff788) at ../../src/main.cpp:786 (gdb)
The trigger to reproduce a crash when tool-switching between node and select tool seems possibly to be timing-related (somtimes, the faster I repeat tool switching by tapping the <space> bar, the more likely the crash occurs). Local trunk builds OTOH do not crash, no matter how fast (or slowly) I repeat the tool switch keyboard shortcut.
The backtrace above is from a different build of your branch on OS X, using older versions of GTK+/Quartz, glib and libsigc++ than the one from which I pasted the backtrace earlier: AFAICT, with the local builds of your branch, neither the compiler (Apple clang 3.1, Apple llvm-gcc-4.2) nor the backend of GTK+ (X11, Quartz) nor the versions of the dependencies seems to make a difference.
More backtraces from crashes with other tools (these don't seem to be consistently reproducible): https://www.dropbox.com/s/3bzeme1c9t5ui2w/branch-cppify-gdb-bt-tool-switch-crashes-osx-64bit.txt The backtraces in this file originate from three different builds (with varying backends/dependency versions).
Possibly these crashes are platform-specific (OS X) - unless someone with a linux build of your branch can reproduce similar issues with tool-switching, this is unlikely a blocker to merge your branch into trunk.
Are the warnings gone I hope?
Just two warnings left about mismatched tags at compile time:
../../src/extension/internal/cairo-render-context.h:32:1: warning: struct 'SPMask' was previously declared as a class [-Wmismatched-tags] ../../src/extension/internal/cairo-renderer.h:31:1: warning: struct 'SPMask' was previously declared as a class [-Wmismatched-tags]
The criticial Gtk warnings at launch (or when opening Fill&Stroke) are gone, yes.