On Jul 2, 2011, at 6:30 AM, ~suv wrote:
https://bugs.launchpad.net/inkscape/+bug/804243
Any widget changes in the dialog result in a crash:
- switch color mode tab
- drag 'Offset' slider
- enter RGBA string in hex
- ...
(AFAICT regression introduced with the merge of the cairo-rendering branch. Only happens when using the "deprecated" gradient editor dialog, instead of using the gradient tool to edit the gradient on-canvas)
This seems like the type of problem where running valgrind, in addition to the backtrace, can be a help. This is a command line I commonly use:
_INKSCAPE_GC=disable valgrind --tool=memcheck --num-callers=24 --log-file=valrun.txt ./inkscape
The first part sets the environment variable to disable our garbage collection, so that valgrind won't get too confused. Another key is "--log-file" which captures the output.
The main intent of running valgrind would be to catch corruption before it gets to the point that it has cascaded into an actual crash. A backtrace will let you know what happened in the direct stack when a crash has occurred. Valgrind tries to catch things much eariler than that.
In this case I see the following:
==32109== Invalid read of size 4 ==32109== at 0x26D8A7B: Gtk::Widget::get_is_drawable() const (in /opt/local/lib/libgtkmm-2.4.1.dylib) ==32109== by 0x26D8AB0: Gtk::Widget::is_drawable() const (in /opt/local/lib/libgtkmm-2.4.1.dylib) ==32109== by 0x765389: Inkscape::UI::Widget::ColorPreview::setRgba32(unsigned int) (in ./inkscape) ==32109== by 0x4EC577: sp_gradient_vector_color_changed(SPColorSelector*, _GtkObject*) (in ./inkscape) ==32109== by 0x42642B4: g_closure_invoke (in /opt/local/lib/libgobject-2.0.0.dylib)
Looking into that last Inkscape method, it's not good: void ColorPreview::setRgba32 (guint32 rgba) { _rgba = rgba;
if (is_drawable()) queue_draw(); }
Combining those, it seems fairly clear that some invalid pointer was used as "this" for that ColorPreview method (note that the is_drawable() function takes no parameters). And finally, looking at the next-to-last line in sp_gradient_vector_color_changed seems to be at least somewhat responsible for the problem.