GNOME Bugzilla – Bug 326806
Segfault from combination of gtk_container_set_resize_mode() and GtkComboBox
Last modified: 2006-01-15 11:33:11 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."
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
+ Trace 65174
Must be some kind of memory corruption. I get different segfaults every time.
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.
Thank you. (BTW my name is "Sebastien" :))