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 161668 - GtkItemFactory stop working with 2.6.0
GtkItemFactory stop working with 2.6.0
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkMenu
2.6.x
Other Linux
: High critical
: ---
Assigned To: gtk-bugs
gtk-bugs
: 162930 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-12-19 01:50 UTC by Marcin Krzyzanowski
Modified: 2011-02-04 16:17 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Marcin Krzyzanowski 2004-12-19 01:50:17 UTC
code :

        GtkItemFactoryEntry menu_items[] = {
                {"/GNU Gadu", NULL, NULL, 0, "<Branch>", NULL},
                {_("/GNU Gadu/Preferences"), NULL, gui_preferences, 0,
"<StockItem>", GTK_STOCK_PREFERENCES},
                {_("/GNU Gadu/"), NULL, NULL, 0, "<Separator>", NULL},
                {_("/GNU Gadu/About"), "<CTRL>a", gui_about, 0, "<StockItem>",
GTK_STOCK_DIALOG_INFO},
                {_("/GNU Gadu/Quit"), "<CTRL>q", gui_quit, 0, "<StockItem>",
GTK_STOCK_QUIT},
                {"/Menu", NULL, NULL, 0, "<Branch>", NULL},
        };
gint Nmenu_items = sizeof (menu_items) / sizeof (menu_items[0]);
accel_group = gtk_accel_group_new();
item_factory = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "<main>", accel_group);


segfault like this :

  • #0 gtk_accel_map_add_filter
    from /usr/lib/libgtk-x11-2.0.so.0
  • #1 gtk_accel_group_unlock
    from /usr/lib/libgtk-x11-2.0.so.0
  • #2 gtk_accel_group_connect_by_path
    from /usr/lib/libgtk-x11-2.0.so.0
  • #3 gtk_widget_set_accel_path
    from /usr/lib/libgtk-x11-2.0.so.0
  • #4 gtk_item_factory_add_foreign
    from /usr/lib/libgtk-x11-2.0.so.0
  • #5 gtk_item_factory_add_foreign
    from /usr/lib/libgtk-x11-2.0.so.0
  • #6 gtk_item_factory_create_item
    from /usr/lib/libgtk-x11-2.0.so.0
  • #7 gtk_item_factory_create_items_ac
    from /usr/lib/libgtk-x11-2.0.so.0
  • #8 gtk_item_factory_create_items
    from /usr/lib/libgtk-x11-2.0.so.0
  • #9 gui_build_default_menu
    at GUI_plugin.c line 685

Comment 1 Elijah Newren 2004-12-19 02:27:12 UTC
Unique stack trace, according to simple-dup-finder.
Comment 2 Marcin Krzyzanowski 2004-12-19 02:35:19 UTC
I missed one line... the code is:

        GtkItemFactoryEntry menu_items[] = {
                {"/GNU Gadu", NULL, NULL, 0, "<Branch>", NULL},
                {_("/GNU Gadu/Preferences"), NULL, gui_preferences, 0,
"<StockItem>", GTK_STOCK_PREFERENCES},
                {_("/GNU Gadu/"), NULL, NULL, 0, "<Separator>", NULL},
                {_("/GNU Gadu/About"), "<CTRL>a", gui_about, 0, "<StockItem>",
GTK_STOCK_DIALOG_INFO},
                {_("/GNU Gadu/Quit"), "<CTRL>q", gui_quit, 0, "<StockItem>",
GTK_STOCK_QUIT},
                {"/Menu", NULL, NULL, 0, "<Branch>", NULL},
        };
gint Nmenu_items = sizeof (menu_items) / sizeof (menu_items[0]);
accel_group = gtk_accel_group_new();
item_factory = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "<main>", accel_group);
gtk_item_factory_create_items(item_factory, Nmenu_items, menu_items, NULL);
Comment 3 Marcin Krzyzanowski 2004-12-19 02:57:15 UTC
full test case :

#include <stdlib.h>
#include <gtk/gtk.h>
#include <string.h>
 
int main()
{
        GtkAccelGroup *accel_group = NULL;
        GtkItemFactory *item_factory;
 
        gtk_init(NULL,NULL);
 
        GtkItemFactoryEntry menu_items[] = {
                {"/GNU Gadu", NULL, NULL, 0, "<Branch>", NULL},
                {"/GNU Gadu/Preferences", NULL, NULL, 0,
                 "<StockItem>", GTK_STOCK_PREFERENCES},
                {"/GNU Gadu/", NULL, NULL, 0, "<Separator>", NULL},
                {"/GNU Gadu/About", "<CTRL>a", NULL, 0, "<StockItem>",
                 GTK_STOCK_DIALOG_INFO},
                {"/GNU Gadu/Quit", "<CTRL>q", NULL, 0, "<StockItem>",
                 GTK_STOCK_QUIT},
                {"/Menu", NULL, NULL, 0, "<Branch>", NULL},
        };
        gint Nmenu_items = sizeof (menu_items) / sizeof (menu_items[0]);
        accel_group = gtk_accel_group_new();
        item_factory = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "<main>",
accel_group);
        gtk_item_factory_create_items(item_factory, Nmenu_items, menu_items, NULL);
}
Comment 4 Matthias Clasen 2004-12-19 05:20:35 UTC
This turned out to be a glib problem:

2004-12-19  Matthias Clasen  <mclasen@redhat.com>

	* glib/goption.c (g_option_context_parse): Call
	post-parse hooks also if argv is NULL.  (#161668,
	Marcin Krzyzanowski)
Comment 5 Matthias Clasen 2004-12-19 05:20:44 UTC
This turned out to be a glib problem:

2004-12-19  Matthias Clasen  <mclasen@redhat.com>

	* glib/goption.c (g_option_context_parse): Call
	post-parse hooks also if argv is NULL.  (#161668,
	Marcin Krzyzanowski)
Comment 6 Matthias Clasen 2005-01-04 17:56:41 UTC
*** Bug 162930 has been marked as a duplicate of this bug. ***