GNOME Bugzilla – Bug 150638
Changing gconf value for 'Lock Screen' key hangs panel.
Last modified: 2015-03-24 13:00:49 UTC
Steps to reproduce ------------------ using gconftool-2 set value for the key `disable_lock_screen`, and simultaneously click on `Panel Menu Button`. Panel hangs. To reproduce this bug frequently execute "sleep 5; gconftool-2 -s /apps/panel/global/disable_lock_screen -t boolean true" and at the mean time click continuously on the `Menu button`, Or you can run the attached test program and click continuously on the 'Menu Button`. NOTE: This does not happen with Panel Menu Bar (Actions Menu) or any other applications. Analysis -------- In Panel Menu Button, Click `Menu Button`, a Pressed signal is emitted, which calls a callback function `panel_menu_button_pressed()->panel_menu_button_popup_menu()` to popup the menu. When a gconf value is set for the key `disable_lock_screen` panel gets notified, function `panel_menu_button_recreate_menu()` is called, which detaches the action menu. Clicking on the `Menu Button` recreats and pops up the Menu. It may so happen that, Clicking on the `Menu Button` and setting gconf value for the key 'disable_lock_screen` may happen simultaneously. Then both the functions (`panel_menu_button_popup_menu()` and `panel_menu_button_recreate_menu()`) may be called at the same time, where one tries to create the menu and the other detaches it. Guess same thing is happening here. Some warning messages when the panel hangs, (gnome-panel:8676): Gtk-CRITICAL **: file gtkwidget.c: line 3358 (gtk_widget_eve nt): assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed (gnome-panel:8676): Gtk-CRITICAL **: file gtkwidget.c: line 3358 (gtk_widget_eve nt): assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed (gnome-panel:8676): Gtk-CRITICAL **: file gtkwidget.c: line 3358 (gtk_widget_eve nt): assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed (gnome-panel:8676): Gtk-CRITICAL **: file gtkwidget.c: line 3358 (gtk_widget_eve nt): assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed In Panel Menu Bar, When an gconf value is set for the key `disable_lock_screen` panel gets notified, function `panel_menu_bar_recreate_actions_menu()` is called, which destroys the action menu and further calls `panel_menu_bar_append_actions_menu()` to recreate the menu and pop up. Possible Solution ----------------- To have the same implementation for `Panel Menu Button` as we have for `Panel Menu Bar`?.
Created attachment 30782 [details] Test Program.
Created attachment 30805 [details] Attaching screenshot
Update, On further debugging it was found that, there still exists an reference on the detached menu. Reference Count shows 1. In Panel-menu-button.c (panel_menu_button_recreate_menu): using gtk_widget_destroy instead of gtk_menu_detach fixed the problem. We need to investigate further. Thanks
This problem is also reproducible in simpler way, Run the following command, `sleep 5; gconftool-2 -s /apps/panel/global/disable_lock_screen -t boolean true' immediately click on `Menu Button`, menu pops up. Leave it untouched. Panel hangs.
Created attachment 30967 [details] [review] Probable fix.
One more strange observation, Panel crashes!. Run the attached program, and then try to remove Menu Bar. Panel crashes.
Stack trace for the crash.
+ Trace 49862
Vijay: did you forget to attach the program?
vincent: I have already attached it, Comment #1 (Test Program).
vuntz: This can be reproduced in simpler way, Run the following command, `sleep 5; gconftool-2 -s /apps/panel/global/disable_lock_screen -t boolean true' (set `true/false` accordingly). Immediately Right click on `Menu Bar` and wait, Panel crashes while setting gconf value.
Doh! I hadn't seen it.
Sorry for the spam. Mass-marking some bugs to the 2.10.x milestone. Filter on "VINCENT WANTS THIS FOR 2.10" to ignore.
Sorry for the delay, Vijay. I committed your patch. Thanks!