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 578334 - Make registryd session friendly
Make registryd session friendly
Status: RESOLVED FIXED
Product: at-spi
Classification: Platform
Component: registry
1.26.x
Other All
: Normal enhancement
: ---
Assigned To: Li Yuan
Li Yuan
: 596115 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-04-08 05:33 UTC by Tomislav Vujec
Modified: 2010-03-02 07:18 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Proposed patch to make registryd session friendly (7.06 KB, patch)
2009-04-08 05:33 UTC, Tomislav Vujec
none Details | Review
new patch (12.05 KB, patch)
2009-08-21 07:54 UTC, Li Yuan
committed Details | Review
use dbus sm api instead of xsmp (12.27 KB, patch)
2009-09-27 21:45 UTC, Matthias Clasen
none Details | Review
modified patch (13.09 KB, patch)
2009-10-16 06:57 UTC, Li Yuan
committed Details | Review

Description Tomislav Vujec 2009-04-08 05:33:05 UTC
Right now, registryd requires wrapper provided by gnome-session, since the only way to check for its successful start is to look at the root window property. With attached patch, it will register with the session manager and signal successful start. As an added bonus, it will register for automatic restart, so that session manager can restart it if it crashes.
Comment 1 Tomislav Vujec 2009-04-08 05:33:41 UTC
Created attachment 132311 [details] [review]
Proposed patch to make registryd session friendly
Comment 2 Li Yuan 2009-05-20 05:16:28 UTC
I tried the patch on Ubuntu, it works. Thanks for the patch.
But on Solaris, with the patch, I can see at-spi-registryd is started by gnome-session. But if I kill it, gnome-session doesn't start a new one. Other applications like vino-server can be restarted. Any suggestions?
Comment 3 Tomislav Vujec 2009-05-20 06:07:49 UTC
I can't see anything in the patch that could cause this behavior. However, there is a possibility that the following happened. gnome-session starts the registryd by default, using its own provided wrapper that will not set it up for autorestart. If that wrapper was used in your solaris installation, registryd will never get the DESKTOP_AUTOSTART_ID in the environment, therefore it will not try to register with the session manager itself. Can you check if you have at-spi-registryd-wrapper.desktop in the autostart path?
Comment 4 Li Yuan 2009-05-20 07:43:59 UTC
No. I have removed that file. And ps shows at-spi-registryd's father is gnome-session.
Comment 5 Tomislav Vujec 2009-05-20 08:28:58 UTC
Sorry, I don't have the Solaris box handy, but if you can debug that the session registration really happens, it would help a lot. There are multiple possibilities I can think of:
1) HAVE_SM is not defined in the build, resulting in session management not really being compiled in. That would cause registry_session_init to be blank. You can check for it by looking into the generated config.h or the compilation command line. Also, you might want to insert some debug message in the registry_session_init. Since the whole function body is enclosed in the ifdef, it would not be printed if this is the case.
2) Session connection is not established successfully. You can put a debug message inside the "if" block in the registry_session_init to check for that.
3) Some problem with treatment of the properties in session. This would actually be a bug in gnome-session solaris version, but this is highly unlikely if other applications are getting restarted. You can check by killing metacity, if it doesn't restart, it means that properties are somehow mishandled by gnome-session, since registryd uses exactly the same set of properties.
4) DESKTOP_AUTOSTART_ID is not in the environment. This is the variable that signals applications that they are being started by gnome-session. If it is not available, registry_session_init will not get executed, which means gnome-session doesn't want to export it for solaris for some reason. Bug or feature?
Comment 6 Tomislav Vujec 2009-05-20 08:32:51 UTC
One more hint. Even if you removed the wrapper from the /etc/xdg, it could be
that it is still present somewhere else in the autostart path (e.g.
/usr/share/gnome/autostart or $HOME, etc.). In that case gnome-session would
still be the parent of the registryd, since the wrapper performs an exec.
Comment 7 Li Yuan 2009-06-01 09:53:30 UTC
Seems the connection is established successfully. But when I killed at-spi-registryd, _disconnect_client in gsm-manager.c is not called (it is called when I kill vino-server). Where could the problem be?
Comment 8 Li Yuan 2009-06-23 08:09:10 UTC
I have tried the patch on atspi-dbus, and it works. I will approve this patch first.
Comment 9 Li Yuan 2009-06-23 08:50:33 UTC
When I tried to logout, a warning dialog pops up. It says "A program is still running - AT SPI Registry Wrapper". I think we need to remove the wrapper code in gnome-session at the same time.
Comment 10 Li Yuan 2009-08-07 09:14:02 UTC
Hi Tomislav, finally I got this work on Solaris!

When I tried to logout, gnome-session notify me :"A program is still running: AT SPI Registry Wrapper". I found this warning is caused by this patch (not the original wrapper). I tried to register callbacks to session manager but the warning dialog is still there. Do you know how to fix this?
Comment 11 Li Yuan 2009-08-21 07:54:37 UTC
Created attachment 141314 [details] [review]
new patch
Comment 12 Matthias Clasen 2009-09-01 17:54:14 UTC
With this patch, at-spi-registryd segfaults in process_ice_messages when I log out.

See https://bugzilla.redhat.com/show_bug.cgi?id=519239 for the stacktrace.
Comment 13 Li Yuan 2009-09-02 02:51:21 UTC
I don't have this problem on Solaris, will try to find out what's happening on Linux.
Comment 14 Matthias Clasen 2009-09-02 14:09:33 UTC
You may have to try this with 'automatically save' in gnome-session-properties checked. Also, the segfault only happens at logout, so the easiest way to catch it is to switch to a vt and attach with gdb to a registryd thats running in your x session, then switch back and log out
Comment 15 Li Yuan 2009-09-03 02:35:31 UTC
(In reply to comment #14)
> You may have to try this with 'automatically save' in gnome-session-properties
> checked. Also, the segfault only happens at logout, so the easiest way to catch
> it is to switch to a vt and attach with gdb to a registryd thats running in
> your x session, then switch back and log out

Yes. I ssh-ed to the machine and used debugger to see what's happening. at-spi-registryd exited normally. But I do see crash on Linux.
Comment 16 Matthias Clasen 2009-09-24 21:43:37 UTC
Any update on this ? This is one of the more common crashes I see in Fedora...
Comment 17 Li Yuan 2009-09-25 07:26:40 UTC
Sorry for not updating the bug. I am sick and in hospital now. Probably will not be back until Oct. 11. And I don't have network for most of time.
Comment 18 Matthias Clasen 2009-09-25 12:18:15 UTC
I hope you get better soon ! In the meantime, I'll look at disabling the SM support then, to stop the crashes.
Comment 19 Matthias Clasen 2009-09-27 21:45:01 UTC
Created attachment 144141 [details] [review]
use dbus sm api instead of xsmp

Here is a patch that uses the dbus sm api instead of xsmp to register registryd with the session manager. This only works with gnome-session >= 2.26, of course.
But it fixes the segfaults at logout...
Comment 20 Matthias Clasen 2009-10-02 23:58:20 UTC
My patch has one issue: it needs to use bonobo_main_quit instead of gtk_main_quit to make registryd actually exit.
Comment 21 Li Yuan 2009-10-13 09:46:41 UTC
Thanks for the patch, Matthias! The patch looks good to me. I will try the patch and commit it when my build environment are set.
Comment 22 Li Yuan 2009-10-16 06:08:11 UTC
After applying this patch, if I kill at-spi-registryd, it will not be restarted automatically. Is there something I missed?
Comment 23 Li Yuan 2009-10-16 06:21:46 UTC
Ah, set X-GNOME-AutoRestart=true should fix this problem.
Comment 24 Li Yuan 2009-10-16 06:57:39 UTC
Created attachment 145582 [details] [review]
modified patch
Comment 25 Matthias Clasen 2009-10-16 12:18:37 UTC
Yes, that should fix it
Comment 26 Li Yuan 2009-11-09 06:20:44 UTC
*** Bug 594287 has been marked as a duplicate of this bug. ***
Comment 27 Li Yuan 2009-11-09 06:22:09 UTC
*** Bug 596115 has been marked as a duplicate of this bug. ***