Menu

#491 [lxsession] lxsession-logout hangs before displaying a menu

-
closed-fixed
nobody
None
5
2016-04-17
2014-12-02
glenvt18
No

Problem: lxsession-logout hangs randomly at the first call of g_dbus_proxy_new_for_bus_sync() in lxsession-logout-dbus-interface.c. Hangs occur more often using a dual-monitor setup.

Enviroment: Ubuntu 14.04. lxsession-logout from the latest master (lxsession.git~73f5bde5b0dd4b39713f81533a33b05e52776feb). I also tested it with 10 y.o+ very slow comptuter with Lubuntu 14.04 and it worked fine.

Solution: g_dbus_proxy_new_for_bus_sync() creates a thread and it looks like there is a race condition somewhere in GTK+ when gtk_init() (or gtk_get_option_group() as in lxsession-logout.c) is called just before. A small test program that reproduces this behavior is attached. If there is a small delay after gtk_init(), even a single printf(), hangs are rare or dissapear completely. But that's not a solution. The only solution I found is to put all dbus-querying code before GTK+ initialization. It was tested and works without hangs. The patch is attached.

2 Attachments

Discussion

  • gilir

    gilir - 2016-04-17

    Thanks, pushed to git

     
  • gilir

    gilir - 2016-04-17
    • status: open --> closed-fixed
     

Log in to post a comment.