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 660139 - GtkGrid gives Gtk-Warnings about negative sizes when empty
GtkGrid gives Gtk-Warnings about negative sizes when empty
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
3.2.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 665862 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-09-26 14:28 UTC by Guillaume Desmottes
Modified: 2012-01-03 08:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix natural/min widht calculations for empty grids. (573 bytes, patch)
2011-10-20 14:49 UTC, Alexander Larsson
accepted-commit_now Details | Review
Fix natural/min widht calculations for empty grids (942 bytes, patch)
2011-10-21 20:25 UTC, Matthias Clasen
committed Details | Review

Description Guillaume Desmottes 2011-09-26 14:28:52 UTC
I get this warning when trying to display a contact:


Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -4 and height 0

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff16fb66c in g_logv (log_domain=0x7ffff79101f7 "Gtk", log_level=G_LOG_LEVEL_WARNING, 
    format=0x7ffff7911ed0 "gtk_widget_size_allocate(): attempt to allocate widget with width %d and height %d", args1=0x7fffffffa7f0)
    at gmessages.c:570
570			G_BREAKPOINT ();
(gdb) bt
  • #0 g_logv
  • #1 g_log
  • #2 gtk_widget_size_allocate
    at gtkwidget.c line 4870
  • #3 gtk_grid_request_allocate_children
    at gtkgrid.c line 1272
  • #4 gtk_grid_size_allocate
    at gtkgrid.c line 1319
  • #5 g_cclosure_marshal_VOID__BOXED
    at gmarshal.c line 574
  • #6 g_type_class_meta_marshal
    at gclosure.c line 885
  • #7 g_closure_invoke
    at gclosure.c line 774
  • #8 signal_emit_unlocked_R
    at gsignal.c line 3202
  • #9 g_signal_emit_valist
    at gsignal.c line 3003
  • #10 g_signal_emit
    at gsignal.c line 3060
  • #11 gtk_widget_size_allocate
    at gtkwidget.c line 4886
  • #12 gtk_grid_request_allocate_children
    at gtkgrid.c line 1272
  • #13 gtk_grid_size_allocate
    at gtkgrid.c line 1319
  • #14 g_cclosure_marshal_VOID__BOXED
    at gmarshal.c line 574
  • #15 g_type_class_meta_marshal
    at gclosure.c line 885
  • #16 g_closure_invoke
    at gclosure.c line 774
  • #17 signal_emit_unlocked_R
    at gsignal.c line 3202
  • #18 g_signal_emit_valist
    at gsignal.c line 3003
  • #19 g_signal_emit
    at gsignal.c line 3060
  • #20 gtk_widget_size_allocate
    at gtkwidget.c line 4886
  • #21 gtk_grid_request_allocate_children
    at gtkgrid.c line 1272
  • #22 gtk_grid_size_allocate
    at gtkgrid.c line 1319
  • #23 g_cclosure_marshal_VOID__BOXED
    at gmarshal.c line 574
  • #24 g_type_class_meta_marshal
    at gclosure.c line 885
  • #25 g_closure_invoke
    at gclosure.c line 774
  • #26 signal_emit_unlocked_R
    at gsignal.c line 3202
  • #27 g_signal_emit_valist
    at gsignal.c line 3003
  • #28 g_signal_emit
    at gsignal.c line 3060
  • #29 gtk_widget_size_allocate
    at gtkwidget.c line 4886
  • #30 gtk_grid_request_allocate_children
    at gtkgrid.c line 1272
  • #31 gtk_grid_size_allocate
    at gtkgrid.c line 1319
  • #32 g_cclosure_marshal_VOID__BOXED
    at gmarshal.c line 574
  • #33 g_type_class_meta_marshal
    at gclosure.c line 885
  • #34 g_closure_invoke
    at gclosure.c line 774
  • #35 signal_emit_unlocked_R
    at gsignal.c line 3202
  • #36 g_signal_emit_valist
    at gsignal.c line 3003
  • #37 g_signal_emit
    at gsignal.c line 3060
  • #38 gtk_widget_size_allocate
    at gtkwidget.c line 4886
  • #39 gtk_viewport_size_allocate
    at gtkviewport.c line 892
  • #40 g_cclosure_marshal_VOID__BOXED
    at gmarshal.c line 574
  • #41 g_type_class_meta_marshal
    at gclosure.c line 885
  • #42 g_closure_invoke
    at gclosure.c line 774
  • #43 signal_emit_unlocked_R
    at gsignal.c line 3202
  • #44 g_signal_emit_valist
    at gsignal.c line 3003
  • #45 g_signal_emit
    at gsignal.c line 3060
  • #46 gtk_widget_size_allocate
    at gtkwidget.c line 4886
  • #47 gtk_container_real_check_resize
    at gtkcontainer.c line 1788
  • #48 g_cclosure_marshal_VOID__VOID
  • #49 g_type_class_meta_marshal
    at gclosure.c line 885
  • #50 g_closure_invoke
    at gclosure.c line 774
  • #51 signal_emit_unlocked_R
    at gsignal.c line 3310
  • #52 g_signal_emit_valist
    at gsignal.c line 3003
  • #53 g_signal_emit
    at gsignal.c line 3060
  • #54 gtk_container_check_resize
    at gtkcontainer.c line 1769
  • #55 gtk_container_idle_sizer
    at gtkcontainer.c line 1659
  • #56 gdk_threads_dispatch
    at gdk.c line 754
  • #57 g_idle_dispatch
    at gmain.c line 4801
  • #58 g_main_dispatch
    at gmain.c line 2441
  • #59 g_main_context_dispatch
    at gmain.c line 3011
  • #60 g_main_context_iterate
    at gmain.c line 3089
  • #61 g_main_loop_run
    at gmain.c line 3297
  • #62 gtk_main
    at gtkmain.c line 1362
  • #63 gtk_application_run_mainloop
    at gtkapplication.c line 115
  • #64 g_application_run
    at gapplication.c line 1323
  • #65 _vala_main
    at main.c line 76
  • #66 main
    at main.c line 87

Comment 1 Alexander Larsson 2011-10-20 14:48:49 UTC
This seems like a GtkGrid bug. Attaching a patch
Comment 2 Alexander Larsson 2011-10-20 14:49:35 UTC
Created attachment 199535 [details] [review]
Fix natural/min widht calculations for empty grids.
Comment 3 Matthias Clasen 2011-10-20 19:39:25 UTC
Review of attachment 199535 [details] [review]:

Good catch.
Comment 4 Matthias Clasen 2011-10-21 20:25:17 UTC
The following fix has been pushed:
bb1d9ab Fix natural/min widht calculations for empty grids
Comment 5 Matthias Clasen 2011-10-21 20:25:20 UTC
Created attachment 199698 [details] [review]
Fix natural/min widht calculations for empty grids
Comment 6 Adrian Zgorzałek 2011-12-27 20:49:08 UTC
It would be nice if this could be finally resolved and merged into master as suggested in link below, since on Arch I still suffer this crash even though I have newest gtk-3.2.3

https://bugs.archlinux.org/task/27708?string=glade&project=1&type[0]=&sev[0]=&pri[0]=&due[0]=&reported[0]=&cat[0]=&status[0]=open&percent[0]=&opened=&dev=&closed=&duedatefrom=&duedateto=&changedfrom=&changedto=&openedfrom=&openedto=&closedfrom=&closedto=
Comment 7 Benjamin Otte (Company) 2011-12-29 09:15:36 UTC
I added a reftest for this and pushed reftest and this fix to the 3.2 branch.
Comment 8 Tristan Van Berkom 2012-01-03 08:34:21 UTC
*** Bug 665862 has been marked as a duplicate of this bug. ***