GNOME Bugzilla – Bug 162500
toolbox without color/foo/image_area crash when adding color widget first in prefs
Last modified: 2010-11-19 22:15:24 UTC
A toolbox separated and in wide shape, without the 3 toolbox area ({color/foo/image}_area as given in gimp_toolbox) as like this: http://popolon.free.fr/scrinshot.jpg in sessionrc, about toolbox: (session-info "toolbox" "dock" (position 345 26) (size 928 66) (open-on-exit) (dock)) crash if the application started like this and gimpfgbgeditor is selected first in preferences->toolbox. Here the states of vars given in the crashing gimp_fg_bg_editor_expose function (in app/widgets/gimpfgbgeditor.c): at the starting of gimp: width:269 height:48 default_w:12 default_h:12 swap_w:12 swap_h:12 rect_w:253 rect_h:34 just after clicking in the prefs checkbox and before crash: width:54 height:1 default_w:12 default_h:12 swap_w:12 swap_h:12 rect_w:38 rect_h:-13 I don't find for why the toolbox as got this values by widget arg as: width = widget->allocation.width; height = widget->allocation.height; There is a warning before the crash: (gimp:21469): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width 54 and height -5 And near the far warnin, if first trying to add foo_area (pattern+brush+gradient) or image_area, width varying to 52 or 54 depending of the area. (gimp:21469): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width 52 and height -5 To avoid a crash, activate on of the 2 other area first. If the fgbgcolor widget is activated after one of the 3 other have been desactivated in same session, there is no crash and the values given to function are: width:54 height:42 default_w:12 default_h:12 swap_w:12 swap_h:12 rect_w:38 rect_h:28 When crash occur: (gimp:25500): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width 54 and height -5 GLib-ERROR **: gmem.c:141: failed to allocate 4294965736 bytes aborting... the value is negative and then seem to be converted directly to an unsigned long integer??? (even if 4294967026 = -5*54 = -270 doesn't match...) The gdb backtrace: (gdb) bt
+ Trace 53972
When trying to reproduce this, I get the warning but not a crash: (gimp-2.2:5398): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width 54 and height -5
As I said (this could not be clear in the amount of not well sorted informations) The crash occur only if: 1) The 3 boxes are desactivated 2) Quit The Gimp 3) Launch The Gimp 4) check in prefs, fg/bg color area checkbox first->Crash
Fixed crash/warnings in both branches: 2005-02-21 Michael Natterer <mitch@gimp.org> * app/widgets/gimptoolbox.c (toolbox_area_notify): apply evil size_request hacks to the color/image/foo areas' wrapbox because its child requisition/allocation code is apparently broken. Works around bug #162500. Setting milestone to 2.4 because that's just a workaround. The real bug seems to be in GtkWrapBox.
Bumping to Future because the workaround described in comment #3 seems to be good enough for 2.4.
WONTFIX because we are getting rid of GtkWrapBox. Definitely with GTK+ 3.x, but this will not be fixed in GIMP 2.x anyway.