GNOME Bugzilla – Bug 469958
GNOME_SESSION environment missing with accessibility enabled
Last modified: 2021-06-14 18:22:23 UTC
Some of the recent changes in the location of the accessibility startup code (in main.c) seemed to have caused a problem where applets (specifically gnome-main-menu) are being started before the GNOME_SESSION is set up in the environment so any calls to connect to the session manager fail. The result is users are no longer able to logout. I'm not exactly sure what the accessibility is doing in the startup but it appears to be activating some components of the gnome-panel or applets which is happening before gnome-session has a chance to get set up. There was a lot of discussion on this in bug #345428
Created attachment 94275 [details] [review] Patch to move the accessibility startup lower in the process I've created a patch that fixes the issue but I'm not sure what accessibility issues this may also cause. The patch simply moves the code to initialize accessibility down to happen after the initialize_ice() call.
Created attachment 94531 [details] [review] patch to main.c which moves the accessibility init code down in the process The initial patch fixed some problems but some of the environment is still not being setup correctly if accessibility is enabled. I moved the accessibility initialization back to where it was (right before gtk_main) and the environment is now correct when accessibility is enabled.
Sorry, I should be more precise in my description. The second patch moves the accessibility initialization back to where it was in revision 4285 of main.c. Here is a link: http://svn.gnome.org/viewcvs/gnome-session/trunk/gnome-session/main.c?revision=4285&view=markup
I don't know the code well enough to comment on correctness etc, but please don't use c++ comments in patches for GNOME - we prefer /* */ type comments :-)
Created attachment 94733 [details] [review] Updated patch with c style comment
What's wrong with your patch is that the a11y modules won't be loaded for processes started before. The right fix is probably just moving gsm_assistive_registry_start() down a bit. Can you try this?
Indeed, Hans Petter Jansson at Novell found the same issue and submitted a new patch for OpenSUSE that changes the location a bit. I'll have him submit the patch here.
Created attachment 99238 [details] [review] gnome-session-2.20.0-safe-a11y-startup.patch This starts up the AT registry before the user's session.
I've tested this patch, and so have at least 3 others, and it's worked well. Note that I sneaked in a wait period of up to 10 seconds instead of 5 for the AT registry to start, since the "missing accessibility" dialog would show up for some users before.
Vincent, I guess Hans' patch is ok to be commited in gnome-2-22 branch? I tested it and it works ok.
I am seeing similar ehavior with gnome-session 2.25.92, 2.25.92-0ubuntu3 to be exact. Since Ubuntu now uses the Fast User switch applet by default for logging out/shutting down, this issue is only visible when the applet is removed, and standard logout/shutdown dialogs are installed. On the Ubuntu 9.04 alpha 6 live CD, with accessibility enabled and the applet removed, the logout/shutdown dialogs are accessible, however running Ubuntu with same set up except for being on hard disk, the dialogs are not accessible. To check that the at-spi registry helper was being loaded too late for the hard disk install, I created a file in /etc/X11/Xsession.d to load /usr/lib/gnome-session/helpers/at-spi-registryd-wrapper. When the helper was run before gnome-session, the logout dialogs were fully accessible. This appears to me that there is a race condition of some sort, since the dialogs on the live CD work fine, probably due to slower load speeds from the CD.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version of gnome-session, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/gnome-session/-/issues/ Thank you for your understanding and your help.