After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 162500 - toolbox without color/foo/image_area crash when adding color widget first in prefs
toolbox without color/foo/image_area crash when adding color widget first in ...
Status: RESOLVED WONTFIX
Product: GIMP
Classification: Other
Component: User Interface
git master
Other All
: Normal normal
: Future
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2004-12-30 00:32 UTC by popolon
Modified: 2010-11-19 22:15 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description popolon 2004-12-30 00:32:56 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
  • #0 __kill
  • #1 raise
    at ../sysdeps/posix/raise.c line 27
  • #2 abort
    at ../sysdeps/generic/abort.c line 88
  • #3 g_logv
    from /usr//lib/libglib-2.0.so.0
  • #4 g_log
    from /usr//lib/libglib-2.0.so.0
  • #5 g_malloc
    from /usr//lib/libglib-2.0.so.0
  • #6 gimp_fg_bg_editor_draw_rect
    at gimpfgbgeditor.c line 286
  • #7 gimp_fg_bg_editor_expose
    at gimpfgbgeditor.c line 369
  • #8 gtk_marshal_VOID__UINT_STRING
    from /usr//lib/libgtk-x11-2.0.so.0
  • #9 g_cclosure_new_swap
    from /usr//lib/libgobject-2.0.so.0
  • #10 g_closure_invoke
    from /usr//lib/libgobject-2.0.so.0
  • #11 g_signal_emit_by_name
    from /usr//lib/libgobject-2.0.so.0
  • #12 g_signal_emit_valist
    from /usr//lib/libgobject-2.0.so.0
  • #13 g_signal_emit
    from /usr//lib/libgobject-2.0.so.0
  • #14 gtk_widget_send_expose
    from /usr//lib/libgtk-x11-2.0.so.0
  • #15 gtk_main_do_event
    from /usr//lib/libgtk-x11-2.0.so.0
  • #16 gdk_window_clear_area_e
    from /usr//lib/libgdk-x11-2.0.so.0
  • #17 gdk_window_process_all_updates
    from /usr//lib/libgdk-x11-2.0.so.0
  • #18 gtk_container_set_reallocate_redraws
    from /usr//lib/libgtk-x11-2.0.so.0
  • #19 g_child_watch_add
    from /usr//lib/libglib-2.0.so.0
  • #20 g_main_depth
    from /usr//lib/libglib-2.0.so.0
  • #21 g_main_context_dispatch
    from /usr//lib/libglib-2.0.so.0
  • #22 g_main_context_dispatch
    from /usr//lib/libglib-2.0.so.0
  • #23 g_main_loop_run
    from /usr//lib/libglib-2.0.so.0
  • #24 app_run
    at app_procs.c line 375
  • #25 main
    at main.c line 473
  • #26 __libc_start_main
    at ../sysdeps/generic/libc-start.c line 129

Comment 1 Sven Neumann 2004-12-30 14:18:32 UTC
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
Comment 2 popolon 2004-12-30 21:38:00 UTC
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
Comment 3 Michael Natterer 2005-02-21 18:25:23 UTC
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.
Comment 4 weskaggs 2006-05-20 23:26:36 UTC
Bumping to Future because the workaround described in comment #3 seems to be good enough for 2.4.
Comment 5 Michael Natterer 2010-11-19 22:15:24 UTC
WONTFIX because we are getting rid of GtkWrapBox. Definitely with GTK+ 3.x,
but this will not be fixed in GIMP 2.x anyway.