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 150638 - Changing gconf value for 'Lock Screen' key hangs panel.
Changing gconf value for 'Lock Screen' key hangs panel.
Status: RESOLVED FIXED
Product: gnome-panel
Classification: Other
Component: panel
2.7.x
Other All
: Normal normal
: ---
Assigned To: Panel Maintainers
Panel Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-08-20 13:40 UTC by Vijaykumar Patwari
Modified: 2015-03-24 13:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test Program. (324 bytes, text/plain)
2004-08-20 13:43 UTC, Vijaykumar Patwari
  Details
Attaching screenshot (32.20 KB, image/png)
2004-08-21 07:19 UTC, Vijaykumar Patwari
  Details
Probable fix. (895 bytes, patch)
2004-08-26 12:15 UTC, Vijaykumar Patwari
none Details | Review

Description Vijaykumar Patwari 2004-08-20 13:40:09 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`?.
Comment 1 Vijaykumar Patwari 2004-08-20 13:43:44 UTC
Created attachment 30782 [details]
Test Program.
Comment 2 Vijaykumar Patwari 2004-08-21 07:19:44 UTC
Created attachment 30805 [details]
Attaching screenshot
Comment 3 Vijaykumar Patwari 2004-08-26 06:00:32 UTC
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
Comment 4 Vijaykumar Patwari 2004-08-26 12:14:19 UTC
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.

Comment 5 Vijaykumar Patwari 2004-08-26 12:15:54 UTC
Created attachment 30967 [details] [review]
Probable fix.
Comment 6 Vijaykumar Patwari 2004-09-03 11:55:59 UTC
One more strange observation, Panel crashes!.

Run the attached program, and then try to remove Menu Bar. Panel crashes.

Comment 7 Vijaykumar Patwari 2004-09-03 12:50:47 UTC
Stack trace for the crash.


  • #0 g_logv
  • #1 g_log
  • #2 panel_applet_create_menu
    at applet.c line 483
  • #3 panel_applet_recreate_menu
    at applet.c line 163
  • #4 marshal_user_data
    at panel-lockdown.c line 406
  • #5 g_closure_invoke
    at gclosure.c line 437
  • #6 panel_lockdown_invoke_closures
    at panel-lockdown.c line 68
  • #7 disable_lock_screen_notify
    at panel-lockdown.c line 110
  • #8 notify_listeners_callback
    at gconf-client.c line 2368
  • #9 notify_listener_list
    at gconf-listeners.c line 588
  • #10 ltable_notify
    at gconf-listeners.c line 654
  • #11 gconf_listeners_notify
    at gconf-listeners.c line 184
  • #12 notify_one_entry
    at gconf-client.c line 2393
  • #13 gconf_client_flush_notifies
    at gconf-client.c line 2433
  • #14 notify_idle_callback
    at gconf-client.c line 2327
  • #15 g_idle_dispatch
    at gmain.c line 3802
  • #16 g_main_dispatch
    at gmain.c line 1942
  • #17 g_main_context_dispatch
    at gmain.c line 2492
  • #18 g_main_context_iterate
    at gmain.c line 2573
  • #19 g_main_loop_run
    at gmain.c line 2777
  • #20 gtk_main
    at gtkmain.c line 1172
  • #21 main
    at main.c line 99
  • #22 __libc_start_main
    from /lib/tls/libc.so.6

Comment 8 Vincent Untz 2004-09-03 15:58:46 UTC
Vijay: did you forget to attach the program?
Comment 9 Vijaykumar Patwari 2004-09-06 03:35:47 UTC
vincent: I have already attached it, Comment #1 (Test Program). 
Comment 10 Vijaykumar Patwari 2004-09-06 04:50:19 UTC
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.
Comment 11 Vincent Untz 2004-09-06 06:21:32 UTC
Doh! I hadn't seen it.
Comment 12 Vincent Untz 2005-01-12 13:57:04 UTC
Sorry for the spam. Mass-marking some bugs to the 2.10.x milestone.
 Filter on "VINCENT WANTS THIS FOR 2.10" to ignore.
Comment 13 Vincent Untz 2005-02-24 21:03:37 UTC
Sorry for the delay, Vijay. I committed your patch. Thanks!