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 326806 - Segfault from combination of gtk_container_set_resize_mode() and GtkComboBox
Segfault from combination of gtk_container_set_resize_mode() and GtkComboBox
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.8.x
Other Linux
: High critical
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2006-01-13 09:26 UTC by Sebastien Bacher
Modified: 2006-01-15 11:33 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastien Bacher 2006-01-13 09:26:26 UTC
That bug has been described on https://bugzilla.ubuntu.com/show_bug.cgi?id=22293

"Hi,

I have found a Gtk+ example that causes a segmentation fault when using Ubuntu
Breezy. I am using Gtk+ version 2.8.6-0ubuntu2.

It appears to be when a Gtk window has it's resize mode set to
gtk.RESIZE_IMMEDIATE and a GtkComboBox is packed into it a segmentation fault is
generated. It does not occur using a GtkLabel. The same code in C also generates
the segmentation fault.
...
The program runs if you:
quote out the line "window.set_resize_mode(gtk.RESIZE_IMMEDIATE)" OR
replace "combo = gtk.ComboBox()" with "combo = gtk.Label('test')"

The equivalent C program that produces the same problem:
(compile with "gcc -g -Wall `pkg-config --cflags --libs gtk+-2.0` test.c -o test")
<snip>
#include <gtk/gtk.h>

int main(int argc, char **argv)
{
   GtkWidget *window, *combo;

   gtk_init(&argc, &argv);

   window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
   gtk_container_set_resize_mode(GTK_CONTAINER(window), GTK_RESIZE_IMMEDIATE);

   combo = gtk_combo_box_new();

   gtk_container_add(GTK_CONTAINER(window), combo);

   gtk_widget_show_all(window);

   gtk_main();

   return 0;
}
</snip>

Replacing the combo box with a label or removing the resize mode causes the
program to run successfully."
Comment 1 Sebastien Bacher 2006-01-13 09:27:31 UTC
backtrace:

Program received signal SIGSEGV, Segmentation fault.
0xb7a12aa9 in IA__g_signal_emit_valist (instance=0x809a808, signal_id=13, detail=0,
    var_args=0xbf7c5258 "$\uffff\t\b.\u0321\uffff\uffff\uffff\uffff\uffff\b\uffff\t\b\210R|\uffff\uffff\233\uffff\uffff") at gsignal.c:2117
2117    {
(gdb) bt
  • #0 IA__g_signal_emit_valist
    at gsignal.c line 2117
  • #1 IA__g_signal_emit_by_name
    at gsignal.c line 2265
  • #2 do_size_request
    at gtksizegroup.c line 592
  • #3 _gtk_size_group_compute_requisition
    at gtksizegroup.c line 788
  • #4 IA__gtk_widget_size_request
    at gtkwidget.c line 2693
  • #5 gtk_window_size_request
    at gtkwindow.c line 4291
  • #6 IA__g_cclosure_marshal_VOID__BOXED
    at gmarshal.c line 566
  • #7 g_type_class_meta_marshal
    at gclosure.c line 567
  • #8 IA__g_closure_invoke
    at gclosure.c line 490
  • #9 signal_emit_unlocked_R
    at gsignal.c line 2368
  • #10 IA__g_signal_emit_valist
    at gsignal.c line 2197
  • #11 IA__g_signal_emit_by_name
    at gsignal.c line 2265
  • #12 do_size_request
    at gtksizegroup.c line 592
  • #13 _gtk_size_group_compute_requisition
    at gtksizegroup.c line 788
  • #14 IA__gtk_widget_size_request
    at gtkwidget.c line 2693
  • #15 gtk_window_compute_configure_request
    at gtkwindow.c line 5141
  • #16 gtk_window_check_resize
    at gtkwindow.c line 5344
  • #17 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #18 g_type_class_meta_marshal
    at gclosure.c line 567
  • #19 IA__g_closure_invoke
    at gclosure.c line 490
  • #20 signal_emit_unlocked_R
    at gsignal.c line 2476
  • #21 IA__g_signal_emit_valist
    at gsignal.c line 2197
  • #22 IA__g_signal_emit
    at gsignal.c line 2241
  • #23 IA__gtk_container_check_resize
    at gtkcontainer.c line 1190
  • #24 _gtk_container_queue_resize
    at gtkcontainer.c line 1166
  • #25 real_queue_resize
    at gtksizegroup.c line 143
  • #26 queue_resize_on_widget
    at gtksizegroup.c line 187
  • #27 IA__gtk_widget_queue_resize
    at gtkwidget.c line 2608
  • #28 IA__gtk_widget_show
    at gtkwidget.c line 2048
  • #29 IA__gtk_widget_show_all
    at gtkwidget.c line 2197
  • #30 gtk_box_forall
    at gtkbox.c line 703
  • #31 IA__gtk_container_foreach
    at gtkcontainer.c line 1292
  • #32 gtk_container_show_all
    at gtkcontainer.c line 2325
  • #33 IA__gtk_widget_show_all
    at gtkwidget.c line 2197
  • #34 gtk_bin_forall
    at gtkbin.c line 166
  • #35 IA__gtk_container_foreach
    at gtkcontainer.c line 1292
  • #36 gtk_container_show_all
    at gtkcontainer.c line 2325
  • #37 IA__gtk_widget_show_all
    at gtkwidget.c line 2197
  • #38 gtk_combo_box_menu_setup
    at gtkcombobox.c line 2436
  • #39 gtk_combo_box_check_appearance
    at gtkcombobox.c line 910
  • #40 gtk_combo_box_size_request
    at gtkcombobox.c line 1781
  • #41 IA__g_cclosure_marshal_VOID__BOXED
    at gmarshal.c line 566
  • #42 g_type_class_meta_marshal
    at gclosure.c line 567
  • #43 IA__g_closure_invoke
    at gclosure.c line 490
  • #44 signal_emit_unlocked_R
    at gsignal.c line 2368
  • #45 IA__g_signal_emit_valist
    at gsignal.c line 2197
  • #46 IA__g_signal_emit_by_name
    at gsignal.c line 2265
  • #47 do_size_request
    at gtksizegroup.c line 592
  • #48 _gtk_size_group_compute_requisition
    at gtksizegroup.c line 788
  • #49 IA__gtk_widget_size_request
    at gtkwidget.c line 2693
  • #50 gtk_window_size_request
    at gtkwindow.c line 4291
  • #51 IA__g_cclosure_marshal_VOID__BOXED
    at gmarshal.c line 566
  • #52 g_type_class_meta_marshal
    at gclosure.c line 567
  • #53 IA__g_closure_invoke
    at gclosure.c line 490
  • #54 signal_emit_unlocked_R
    at gsignal.c line 2368
  • #55 IA__g_signal_emit_valist
    at gsignal.c line 2197
  • #56 IA__g_signal_emit_by_name
    at gsignal.c line 2265
  • #57 do_size_request
    at gtksizegroup.c line 592
  • #58 _gtk_size_group_compute_requisition
    at gtksizegroup.c line 788
  • #59 IA__gtk_widget_size_request
    at gtkwidget.c line 2693
  • #60 gtk_window_compute_configure_request
    at gtkwindow.c line 5141

Comment 2 Matthias Clasen 2006-01-14 07:06:40 UTC
Must be some kind of memory corruption. I get different segfaults every time.
Comment 3 Matthias Clasen 2006-01-15 04:10:13 UTC
2006-01-14  Matthias Clasen  <mclasen@redhat.com>

	Fix a crash with combo boxes in RESIZE_IMMEDIATE
	containers.  (#326806, Sebastian Bacher)
	
	* gtk/gtkcombobox.c (gtk_combo_box_size_allocate) 
	(gtk_combo_box_size_request): Don't call 
	gtk_combo_box_check_appearance() from here, as that 
	can lead to recursion. 
	(gtk_combo_box_init): Instead, call it here.
Comment 4 Sebastien Bacher 2006-01-15 11:33:11 UTC
Thank you. (BTW my name is "Sebastien" :))