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 133428 - wnck-applet crashed when I clicked on the Window Selector applet in an empty workspace
wnck-applet crashed when I clicked on the Window Selector applet in an empty ...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkMenu
2.4.x
Other Linux
: High critical
: ---
Assigned To: Havoc Pennington
Havoc Pennington
: 134451 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-02-04 19:32 UTC by Vincent Noel
Modified: 2011-02-04 16:16 UTC
See Also:
GNOME target: 2.6.next
GNOME version: ---


Attachments
gtkmenu.c patch (836 bytes, patch)
2004-02-17 04:28 UTC, Gustavo Giráldez
none Details | Review

Description Vincent Noel 2004-02-04 19:32:44 UTC
If you switch to an empty workspace and use the Window Selector applet to
switch to an existing window (in another workspace), "wnck-applet" will
crash (and with it the Window Selector applet and the workspace switcher
applet and the window list applet). 
If there are already windows in the workspace, there is no crash.

This is with the CVS version of libwnck and gnome-panel 2.5.4.
Comment 1 Gustavo Giráldez 2004-02-17 04:18:56 UTC
I'm getting this as well.

  • #0 _dl_sysinfo_int80
    from /lib/ld-linux.so.2
  • #1 __waitpid_nocancel
    from /lib/tls/libpthread.so.0
  • #2 libgnomeui_segv_handle
    at gnome-ui-init.c line 741
  • #3 <signal handler called>
  • #4 gtk_menu_size_allocate
    at gtkmenu.c line 2166
  • #5 g_cclosure_marshal_VOID__BOXED
    at gmarshal.c line 566
  • #6 g_type_class_meta_marshal
    at gclosure.c line 514
  • #7 g_closure_invoke
    at gclosure.c line 437
  • #8 signal_emit_unlocked_R
    at gsignal.c line 2366
  • #9 g_signal_emit_valist
    at gsignal.c line 2195
  • #10 g_signal_emit
    at gsignal.c line 2239
  • #11 gtk_widget_size_allocate
    at gtkwidget.c line 2706
  • #12 gtk_window_size_allocate
    at gtkwindow.c line 4021
  • #13 g_cclosure_marshal_VOID__BOXED
    at gmarshal.c line 566
  • #14 g_type_class_meta_marshal
    at gclosure.c line 514
  • #15 g_closure_invoke
    at gclosure.c line 437
  • #16 signal_emit_unlocked_R
    at gsignal.c line 2366
  • #17 g_signal_emit_valist
    at gsignal.c line 2195
  • #18 g_signal_emit
    at gsignal.c line 2239
  • #19 gtk_widget_size_allocate
    at gtkwidget.c line 2706
  • #20 gtk_menu_popup
    at gtkmenu.c line 1293
  • #21 window_menu_popup_menu
    at window-menu.c line 636
  • #22 window_menu_button_press_event
    at window-menu.c line 650
  • #23 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 82
  • #24 g_closure_invoke
    at gclosure.c line 437
  • #25 signal_emit_unlocked_R
    at gsignal.c line 2436
  • #26 g_signal_emit_valist
    at gsignal.c line 2205
  • #27 g_signal_emit
    at gsignal.c line 2239
  • #28 gtk_widget_event_internal
    at gtkwidget.c line 3558
  • #29 gtk_propagate_event
    at gtkmain.c line 2349
  • #30 gtk_main_do_event
    at gtkmain.c line 1581
  • #31 gdk_event_dispatch
    at gdkevents-x11.c line 2131
  • #32 g_main_dispatch
    at gmain.c line 1752
  • #33 g_main_context_dispatch
    at gmain.c line 2296
  • #34 g_main_context_iterate
    at gmain.c line 2377
  • #35 g_main_loop_run
    at gmain.c line 2597
  • #36 bonobo_main
    at bonobo-main.c line 297
  • #37 bonobo_generic_factory_main_timeout
    at bonobo-generic-factory.c line 384
  • #38 bonobo_generic_factory_main
    at bonobo-generic-factory.c line 341
  • #39 panel_applet_factory_main_closure
    at panel-applet.c line 1556
  • #40 panel_applet_factory_main
    at panel-applet.c line 1580
  • #41 main
    at wncklet.c line 82
  • #4 gtk_menu_size_allocate
    at gtkmenu.c line 2166
menu = (GtkMenu *) 0x8e398b8
menu_shell = (GtkMenuShell *) 0x8e398b8
child = (GtkWidget *) 0xbfed0544
child_allocation = {x = -1074985660, y = 147240392, width = -1074986264,
  height = 3934053}
child_requisition = {width = 0, height = 63}
priv = (GtkMenuPrivate *) 0x8e36df8
children = (GList *) 0x8c6b4f0
x = 2
y = 149133496
width = 1
height = 148449656
vertical_padding = 1
(gdb) p priv->columns
$3 = 0
(gdb) p *priv
$14 = {have_position = 1, x = 1132, y = 23, rows = 3, columns = 0,
  heights = 0x8e36ca8, heights_length = 3, monitor_num = 0}

Sounds like a Gtk+ bug.
Comment 2 Gustavo Giráldez 2004-02-17 04:27:10 UTC
Ok, I think it is indeed a bug in Gtk+.  The attached patch to Gtk+
HEAD fixes this issue for me.

The problem is the last operation on the menu is a remove, and because
it was the first menu item which is being removed, the number of
columns is never recalculated (i.e. the else part is never reached).

Hope this helps.
Comment 3 Gustavo Giráldez 2004-02-17 04:28:13 UTC
Created attachment 24469 [details] [review]
gtkmenu.c patch
Comment 4 Luis Villa 2004-02-17 04:32:43 UTC
Federico, can you look at the problem and the patch, please?
Comment 5 Matthias Clasen 2004-02-17 08:16:27 UTC
I don't think that patch can fix the problem. priv->columns should 
already be set in set_child_property. The simplest fix is probably to 
change 




priv->columns = 0; 




to




priv->columns = 1;




before the loop, ie let menus always have at least one column, even if 
they're empty. The alternative would be to check for 0 before the 
division in line 2166.
Comment 6 Gustavo Giráldez 2004-02-17 09:29:17 UTC
Well, the patch *does* fix the problem :-)  But setting the columns to
1 instead of 0 is indeed a better solution, I agree.
Comment 7 Mark McLoughlin 2004-02-18 10:26:39 UTC
*** Bug 134451 has been marked as a duplicate of this bug. ***