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 634988 - my computer is too fast
my computer is too fast
Status: RESOLVED OBSOLETE
Product: gnome-settings-daemon
Classification: Core
Component: general
2.32.x
Other All
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2010-11-16 15:40 UTC by Allison Karlitskaya (desrt)
Modified: 2012-09-23 19:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Pathc to make g-s-d wait a little bit for the gdm's g-s-d to end (1.77 KB, patch)
2011-03-29 08:38 UTC, Rodrigo Moya
committed Details | Review

Description Allison Karlitskaya (desrt) 2010-11-16 15:40:56 UTC
I have a pretty fast system with solid state disks.

When I login to my machine there is no GTK theme -- just the default ugly one.

If I check the xsession error log, I see a message to the effect of "Only one X Settings provider may be running at once".  Happens 100% of the time and the only way to fix it is by killing off the settings daemon and restarting it.

I thought that maybe my login happened too quickly and the XSettings manager from gdm had not exited yet, so I tried making my login slower.

root@velocity:~# echo sleep 1 > /etc/X11/Xsession.d/50slowdownthere

fixed it.  100% of the time.


Either we should change something about the login process to make sure the settings daemon from gdm is fully exited before starting the user's gnome-settings-daemon or we should make gnome-settings-daemon more robust against finding a display with an existing XSettings manager (maybe it should wait internally for a second or two before giving up).
Comment 1 Bastien Nocera 2010-11-17 13:34:15 UTC
Are you sure about the error message? It doesn't seem to come from gnome-settings-daemon in any case.

What session type are you running? Is it gnome-shell or classic?
Comment 2 Allison Karlitskaya (desrt) 2010-11-17 21:57:16 UTC
"classic", as per Ubuntu 10.10.


** (gnome-settings-daemon:7613): WARNING **: You can only run one xsettings manager at a time; exiting

** (gnome-settings-daemon:7613): WARNING **: Unable to start xsettings manager: Could not initialize xsettings manager.
Comment 3 Bastien Nocera 2010-11-18 03:59:42 UTC
This looks like a GDM bug to me. Ray?
Comment 4 Rodrigo Moya 2011-01-21 12:11:13 UTC
BTW, lots of people getting this same bug at https://bugs.launchpad.net/gnome-settings-daemon/+bug/649809 . It looks indeed like it's a GDM bug
Comment 5 Rodrigo Moya 2011-03-03 10:28:39 UTC
Ryan, can you please replicate it and try getting the g_debug from client_proxy_signal_cb() output somewhere?
Comment 6 Ray Strode [halfline] 2011-03-03 15:04:41 UTC
gdm does the equivalent of:

kill (pid_of_gnome_session, SIGTERM);

wait_again:

waitpid (pid_of_gnome_session, &status, 0);
if (waitpid returned EINTR)
   goto wait_agan;

So GDM is waiting for gnome-session to exit.  gnome-session must be exiting early before gnome-settings-daemon exits.
Comment 7 Rodrigo Moya 2011-03-29 08:38:39 UTC
Created attachment 184538 [details] [review]
Pathc to make g-s-d wait a little bit for the gdm's g-s-d to end
Comment 8 Bastien Nocera 2011-03-29 10:11:02 UTC
I don't like it. Feels like it's working around the problem.
Comment 9 Rodrigo Moya 2011-03-29 10:28:25 UTC
Yes, I don't like it neither, but after debugging a lot this issue and confirming that gdm waits correctly for gnome-session to end and gnome-session waits for g-s-d to end (I even tested adding a sleep(30) to g-s-d to try to replicate this on my non-so-fast machine), the issue really seems to be with X, which has the property set by the xsettings manager not removed inmediately when g-s-d dies, but a few milliseconds after that, which is enough to run into this problem on fast machines.
Comment 10 Allison Karlitskaya (desrt) 2011-03-29 14:44:58 UTC
i think the issue is that even though g-s-d has been killed, X needs to notice this and update itself internally accordingly.  that doesn't happen before X gets the new request.

we could add some new serialisation in gdm (ie: waiting until we see the XSettings provider go away from X's point of view before starting the desktop) but i actually like this approach because it reduces the amount of serialisation -- no extra delays when they are not needed.
Comment 11 Allison Karlitskaya (desrt) 2011-03-29 14:46:33 UTC
Review of attachment 184538 [details] [review]:

as for the patch, i looked at it earlier on irc and it seems fine.  i might add a comment /* 100ms */ in the appropriate spot for clarity.

rodrigo said that he intends to test the patch in ubuntu to seek feedback before pushing it upstream.
Comment 12 Josselin Mouette 2011-03-29 14:52:40 UTC
It also happens for Debian users sometimes. Thanks for the analysis.
Comment 13 Rodrigo Moya 2011-03-29 15:34:26 UTC
Yes, already tested and confirmed fixed by several Ubuntu users:

https://bugs.launchpad.net/gnome-settings-daemon/+bug/649809

(see the last few comments)
Comment 14 Matthias Clasen 2011-03-29 17:20:38 UTC
(In reply to comment #10)
> i think the issue is that even though g-s-d has been killed, X needs to notice
> this and update itself internally accordingly.  that doesn't happen before X
> gets the new request.
.

That sounds very unlikely. This would be a tiny race.
Comment 15 Allison Karlitskaya (desrt) 2011-03-30 05:35:39 UTC
I've requested a freeze exception for Rodrigo's patch:

https://mail.gnome.org/archives/release-team/2011-March/msg00566.html
Comment 16 Allison Karlitskaya (desrt) 2011-03-30 06:03:49 UTC
Ray: release team is asking for your opinion
Comment 17 Allison Karlitskaya (desrt) 2011-03-30 06:32:50 UTC
We have 2/2 but I think there is no harm in waiting a couple of days for feedback from some gdm people before we proceed.
Comment 18 Brian Cameron 2011-03-30 06:49:49 UTC
This proposed solution looks like a hack to me.  It may address a symptom, but I imagine it is not solving the underlying problem.

Since GDM was rewritten, numerous bugs have been exposed caused by the GDM welcome session not exiting cleanly and leaving things in bad state for the user session which is started after authentication.  Bug #607658 is an example.  I know that we have also had some problems on Solaris with stale Xatoms left behind by the GDM session causing odd behaviors in the user session.

It does not seem like we have a full understanding of all the issues and possible race conditions that could cause issues with GDM stopping the welcome session and starting the user session.  So I anticipate that we will continue to find similar problems until we have a more robust solution.

That said, if this hack makes GNOME work better, I see no harm in it.  This late in the release cycle, such a minimally intrusive fix may make the most sense.

I recommend planning to remove this hack after doing the 3.0 release and work towards actually fixing the underlying problems properly in a more sane way.  I should think we could fix the user session or the Xserver so that GDM can be provided with a more clear indication of when it is safe to go ahead and start the user session.

Fixing this on a per-application basis (like this patch fixing gnome-settings-daemon), seems a temporary fix at best.
Comment 19 Josselin Mouette 2011-03-30 07:04:18 UTC
(In reply to comment #18)
> Fixing this on a per-application basis (like this patch fixing
> gnome-settings-daemon), seems a temporary fix at best.

While the fix certainly needs to be made a proper one (probably in the X server), I don’t think anything else than gnome-settings-daemon needs fixing. The processes are all guaranteed to have exited before we start the user session, and the only thing that is supposed to leave things in the X server is g-s-d.
Comment 20 Rodrigo Moya 2011-03-30 14:24:07 UTC
(In reply to comment #14)
> (In reply to comment #10)
> > i think the issue is that even though g-s-d has been killed, X needs to notice
> > this and update itself internally accordingly.  that doesn't happen before X
> > gets the new request.
> .
> 
> That sounds very unlikely. This would be a tiny race.

it's enough in fast machines, it seems
Comment 21 Bastien Nocera 2011-03-30 14:46:19 UTC
(In reply to comment #20)
> (In reply to comment #14)
> > (In reply to comment #10)
> > > i think the issue is that even though g-s-d has been killed, X needs to notice
> > > this and update itself internally accordingly.  that doesn't happen before X
> > > gets the new request.
> > .
> > 
> > That sounds very unlikely. This would be a tiny race.
> 
> it's enough in fast machines, it seems

If the race is tiny, and it's indeed the problem, why do we wait for 0.1 seconds?
Comment 22 Rodrigo Moya 2011-03-30 14:58:27 UTC
(In reply to comment #21)
> (In reply to comment #20)
> > (In reply to comment #14)
> > > (In reply to comment #10)
> > > > i think the issue is that even though g-s-d has been killed, X needs to notice
> > > > this and update itself internally accordingly.  that doesn't happen before X
> > > > gets the new request.
> > > .
> > > 
> > > That sounds very unlikely. This would be a tiny race.
> > 
> > it's enough in fast machines, it seems
> 
> If the race is tiny, and it's indeed the problem, why do we wait for 0.1
> seconds?

the problem was fixed for people adding a sleep 1, so it's anything less than 1 second. If you have a better number, I'm ok with changing the patch, but I don't know exactly how many milliseconds it is.
Comment 23 Rodrigo Moya 2011-03-31 16:03:10 UTC
Review of attachment 184538 [details] [review]:

Got 2 approvals from r-t, so pushed this to master. Keeping the bug open though, so that we get a better fix for 3.0.1
Comment 24 André Klapper 2011-03-31 16:04:44 UTC
Workaround committed, hence removing blocker flag.
Comment 25 Josselin Mouette 2011-04-09 13:16:14 UTC
Has the bug already been reported against the X server? Otherwise I can do it if no one steps in.
Comment 26 Allison Karlitskaya (desrt) 2011-04-09 18:13:50 UTC
This is almost certainly not an X bug.
Comment 27 Josselin Mouette 2011-04-09 19:34:48 UTC
(In reply to comment #26)
> This is almost certainly not an X bug.

Where would it be then? I don’t see many possibilities here:
 - a design error in the Xsettings specification;
 - the Xsettings specification being wrongly implemented;
 - the X server not providing accurate information.
Comment 28 Allison Karlitskaya (desrt) 2011-04-09 22:09:54 UTC
All that's here is a race that occurs between the XSettings provider starting and the previous one exiting after it has been *requested* to exit.

There could be very many things that delay this request from being turned into an actual exit.  It could also be that it does exit, but X doesn't notice right away that the socket is dropped -- X can't do anything better in this case anyway since it's up to the OS to schedule it.
Comment 29 Josselin Mouette 2011-04-10 08:16:47 UTC
(In reply to comment #28)
> All that's here is a race that occurs between the XSettings provider starting
> and the previous one exiting after it has been *requested* to exit.

I thought that the gnome-session process in the login session would exit only after g-s-d has exited.  If not, that could be fixed in gnome-session.
Comment 30 Ray Strode [halfline] 2011-04-28 17:40:01 UTC
so one possibility is gnome-session could be crashing after it tells all the clients to go away before they actually do.  If that happened then login would proceed before the clients finished exiting.

desrt is going to try to set up a reproduction environment when he gets home and attach to the gnome-session process to see if it's crashing.
Comment 31 Allison Karlitskaya (desrt) 2011-04-28 22:22:18 UTC
I'm sorry Ray -- I forgot that I don't have this bug on any of my machines anymore since I moved from Ubuntu to Debian on my home machine (which was the only one I ever experienced the problem with).

Perhaps Rodrigo can help more.
Comment 32 Ray Strode [halfline] 2011-04-28 22:39:09 UTC
Rodrigo, would you mind gdb attaching to gdm's gnome-session and trying to log in, reproduce, etc and see if gnome-session ends up exiting or crashing?
Comment 33 Ray Strode [halfline] 2011-04-29 15:26:52 UTC
I also wonder when this happens if there's a message like this:

WARNING: Client '/org/gnome/SessionManager/ClientN' failed to reply before timeout

in /var/log/messages or /var/log/gdm/:0-greeter.log
Comment 34 Rodrigo Moya 2011-05-02 21:23:41 UTC
I'm sorry, but I haven't been able to reproduce this problem at all. There are lots of Ubuntu users though getting it (before the fix was done), so I'll try to get someone with enough knowledge to do the debugging.
Comment 35 Tobias Mueller 2011-06-25 15:01:50 UTC
So what do we do with this bug now? Closing as OBSOLETE?
Comment 36 Ray Strode [halfline] 2011-06-27 17:02:59 UTC
Well, without anyone to reproduce there's not much we can do I guess.  We could revert the workaround in an attempt to make the problem happen again, but I think we have bigger fish to fry.

Let's WONTFIX for now, and revisit later if it ever comes up again.
Comment 37 Richard Hughes 2011-09-30 09:14:22 UTC
I've been profiling g-s-d startup time. The make-it-work hack adds a whopping 400ms to the g-s-d startup time. Has any work been done to address the actual problem since 3.0 or are we destined to work around this forever? Thanks.
Comment 38 Ray Strode [halfline] 2011-09-30 21:41:37 UTC
i'd say we should revert it for the 3.4 devel period, see if the problem comes back to a reproducible state, and if so, fix it.
Comment 39 Matthias Clasen 2011-10-20 12:09:00 UTC
Has this been reverted ? 3.4 development is underway now...
Comment 40 Rodrigo Moya 2011-10-20 14:11:20 UTC
Yes, already reverted in git master
Comment 41 Ray Strode [halfline] 2011-10-20 14:30:41 UTC
okay, hopefully the bug will start happening again so we can fix it.
Comment 42 Bastien Nocera 2012-09-21 12:09:19 UTC
We completely nuked the d-bus autostart capability of gnome-settings-daemon, so it should now get started through gnome-session only. Do you still see this Ryan?
Comment 43 Allison Karlitskaya (desrt) 2012-09-23 14:00:38 UTC
I haven't seen this in a long time... I stopped using that computer, though :)
Comment 44 Bastien Nocera 2012-09-23 19:28:42 UTC
(In reply to comment #43)
> I haven't seen this in a long time... I stopped using that computer, though :)

You should! It's fast! Let's close this then.