[Bug 22293] New: Segfault from combination of gtk_container_set_resize_mode() and GtkComboBox

bugzilla-daemon at bugzilla.ubuntu.com bugzilla-daemon at bugzilla.ubuntu.com
Wed Jan 11 15:41:01 UTC 2006


Please do not reply to this email.  You can add comments at
http://bugzilla.ubuntu.com/show_bug.cgi?id=22293
Ubuntu | python-gtk2

           Summary: Segfault from combination of
                    gtk_container_set_resize_mode() and GtkComboBox
           Product: Ubuntu
           Version: unspecified
          Platform: i386
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: python-gtk2
        AssignedTo: seb128 at ubuntu.com
        ReportedBy: robert.ancell at gmail.com
         QAContact: desktop-bugs at lists.ubuntu.com


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.

A python script that will segfault:
<snip>
#!/usr/bin/env python

import gtk

# Create a window (nothing special here)
window = gtk.Window()

# The combination of this method and the following combo box causes a
segmentation fault
window.set_resize_mode(gtk.RESIZE_IMMEDIATE)

# Create a combo box
combo = gtk.ComboBox()
window.add(combo)

# Show the lot
# Note: The segfault occurs after this call
window.show_all()
gtk.main()
</snip>

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.

Thanks,
--Robert Ancell

-- 
Configure bugmail: http://bugzilla.ubuntu.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.




More information about the desktop-bugs mailing list