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 679705 - Using NULL with gtk_application_set_menubar causes segfault
Using NULL with gtk_application_set_menubar causes segfault
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.4.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-07-10 20:23 UTC by Zachary Dovel
Modified: 2012-07-11 01:24 UTC
See Also:
GNOME target: ---
GNOME version: 3.3/3.4



Description Zachary Dovel 2012-07-10 20:23:34 UTC
Removing a menubar by passing NULL to gtk_application_set_menubar causes a segfault.  I have not tested this with the application menu.  According to the gtk documentation at <http://developer.gnome.org/gtk3/3.3/GtkApplication.html#gtk-application-set-menubar>,  this should be valid. I am currently using an empty GMenu to work around this bug.

STEPS TO REPRODUCE:

1. Create a GtkApplication
2. gtk_application_set_menubar (application, menu_model);
3. gtk_application_set_menubar (application, NULL);

BACKTRACE:

Program received signal SIGSEGV, Segmentation fault.
0xb78046d7 in g_menu_model_get_n_items () from /usr/lib/libgio-2.0.so.0
(gdb) backtrace
  • #0 g_menu_model_get_n_items
    from /usr/lib/libgio-2.0.so.0
  • #1 ??
    from /usr/lib/libgtk-3.so.0
  • #2 gtk_application_set_menubar
    from /usr/lib/libgtk-3.so.0
  • #3 gw_window_load_menubar
    at window.c line 531