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 569039 - Selecting desktop environment doesn't work reliably
Selecting desktop environment doesn't work reliably
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
2.25.x
Other Linux
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
: 568669 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-01-25 03:09 UTC by Vincent Untz
Modified: 2011-06-14 00:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (1.85 KB, patch)
2009-01-25 03:09 UTC, Vincent Untz
none Details | Review
Stop sending back the saved session name (1.60 KB, patch)
2011-06-03 09:09 UTC, Gary Ching-Pang Lin
committed Details | Review

Description Vincent Untz 2009-01-25 03:09:22 UTC
Forwarding https://bugzilla.novell.com/show_bug.cgi?id=460591

=====
I have Gnome and KDE4 installed. With default gdm I can't control which desktop
to load. For example:
using gnome - log off
select kde - gnome loads, log off
select gnome - kde loads

[...]

I notice the SavedSessionNameRead D-Bus signal in gdm-session-worker is emitted
many times at the login time. In fact, it should only be emitted at the first
time while gdm_session_settings_load is called.

After user chooses another DE different from the default one, a calling circle
of signals has been built -- 
gdm-simple-greeter (SelectSession)->
gdm-simple-slave(SetSessionName)->
gdm-session-worker(gdm_session_settings_set_session_name)->
gdm-session-worker(GdmSessionSettings "session-name")->
gdm-session-worker (SavedSessionNameRead)->
gdm-session-slave (SetDefaultSessioName)->
gdm-session-slave("default-session-changed")->
gdm-session-slave(DefaultSessionNameChanged)->
gdm-simple-greeter("default-session-name-changed")->
gdm-simple-greeter(gdm_greeter_panel_set_default_session_name)->
gdm-simple-greeter(on_default_item_changed)->
gdm-simple-greeter("session-activate")->
gdm-simple-greeter(SelectSession)..........

and gdm-session-work endlessly set the real session
gnome->kde4->gnome->kde4->gnome->kde4 until gdm-simple-greeter exits. You have
50% chance to login to the session you want.
=====

Attaching a patch by Ming Xi Wu <mxwu novell com>
Comment 1 Vincent Untz 2009-01-25 03:09:49 UTC
Created attachment 127181 [details] [review]
Patch
Comment 2 Ray Strode [halfline] 2009-07-17 17:39:44 UTC
Is this patch still relevant? I can't reproduce the original problem.

If there is a cycle here I don't think the proposed patch is the right place to break it, but I guess I won't know for sure until I know:

1) if this is still a problem
2) more details about how the problem is happening
Comment 3 Vincent Untz 2009-12-04 19:21:07 UTC
Ming Xi, can you answer questions above?
Comment 4 Mingxi Wu 2009-12-05 15:42:37 UTC
I can rarely reproduce this bug now.

But it is still a potential problem.
If you add a log in on_saved_session_name_read, then login to other session through "other" entry, you'll find on_saved_session_name_read has been called many times.

For example, this bad behavior can cause the language reset to "C":

1. install 2 DE like gnome and icewm.
2. start gdm and select "other", input user name. now saved language is en_US, and session is GNOME.
3. set session to icewm.
4. cancel.
5. select other and input user name again.
5. select GNOME.
6. inpute password and login.
7. language reset to "C".

My patch is OK. After gdm_session_settings_load has been called, saved_*_read loading is done, breaking the cycle here is very safe.
Comment 5 William Jon McCann 2010-06-17 00:44:11 UTC
*** Bug 568669 has been marked as a duplicate of this bug. ***
Comment 6 Gary Ching-Pang Lin 2011-06-03 09:06:52 UTC
I also bumped into this bug with gdm 3.0.4 and found that there was an dbus message loop formed between the greeter, the slave, and the worker. The loop is caused by dbus_connection_send_with_reply_and_block() in the worker for "SecretInfoQuery".

Since the function stops the worker from processing any dbus signal until the slave replies the worker, multiple "SetSessionName" signals are queued. If there are 2 signals with different session name, then a loop will be formed.

The loop looks like this: "SelectSession"(greeter) -> "SetSessionName"(slave) -> "SavedSessionNameRead"(worker) -> "SetDefaultSessionName"(slave) -> "SelectSession"(greeter) -> ...

For the normal case, i.e. just one "SetSessionName", the loop stops in the slave and the slave will not send the "SetDefaultSessionName" to the greeter.

However, if two signal are queued, e.g. gnome and icewm, and processed in a very short interval, the saved session name in the 3 processes will be overwritten over and over again, and this forms the loop.

Once the loop is formed, a random session selection will happen.
Comment 7 Gary Ching-Pang Lin 2011-06-03 09:09:03 UTC
Created attachment 189147 [details] [review]
Stop sending back the saved session name

I followed the idea of the patch in comment#1 and made a new patch since the previous patch doesn't work for gdm3. It breaks the loop and works for me.
Comment 8 Ray Strode [halfline] 2011-06-06 14:06:10 UTC
The problem this sort of patch used to have, is it meant we wouldn't get session updates for ~/.dmrc files that arrived late (because of say nfs home dirs).

Now that we use accounts service this sort of patch is probably fine though.
Comment 9 Ray Strode [halfline] 2011-06-14 00:38:13 UTC
Thanks, I've pushed this.