Ensure wayland -> xorg fallback to the corresponding session

Bug #1718446 reported by Didier Roche-Tolomelli
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gdm
Fix Released
Medium
gdm3 (Ubuntu)
Fix Released
High
Olivier Tilloy
Artful
Fix Released
High
Olivier Tilloy
gnome-session (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

Users upgrading to artful on a system that cannot run wayland may be logged into an unexpected session at the next boot.

[Steps to reproduce]

1. On a system with wayland capability, log into the "Ubuntu" session.
2. Install gnome-session if it wasn't already installed (this adds two sessions, "GNOME" and "GNOME on Xorg").
3. Disable wayland (uncomment WaylandEnable=false in /etc/gdm3/custom.conf) and reboot.

Expected result: at the greeter, the "Ubuntu on Xorg" session is selected by default (falling back from "Ubuntu" to "Ubuntu on Xorg").

Actual result: at the greeter, the "GNOME on Xorg" session is selected by default.

[Fix]

The fix consists in using the default fallback mechanism in gdm3, i.e. /usr/share/wayland-sessions/ubuntu.desktop falls back to /usr/share/xsessions/ubuntu.desktop, adding corresponding "-xorg.desktop" session files, and having gdm3 ignore them under wayland. This was discussed and approved upstream (https://bugzilla.gnome.org/show_bug.cgi?id=788552).
The fix involves a distro-patch in gdm3 (already merged upstream, will go away with the next release) and changes to the packaging of gnome-session (added symlinks).

[Test Case]

see [Steps to reproduce]

[Regression Potential]

The gdm3 patch has been thoroughly tested and merged upstream. Since this is C glib code, reviewers should carefully look for possible memory leaks, as strings are being allocated.

If a package installs /usr/share/xsessions/foo-xorg.desktop without a corresponding /usr/share/xsessions/foo.desktop, the session will be ignored if wayland is disabled. It is however considered a standard practice that foo-xorg is a fallback for foo, so it wouldn't make much sense to have the former without the latter.

In case of a partial upgrade:
 - only gdm3 upgraded: nothing user-visible should happen, as gdm will ignore the foo-xorg session only if the corresponding foo session file exists
 - only gnome-session upgraded: with wayland disabled, at the greeter the user might see two sessions that are in fact the same thing: "Ubuntu" and "Ubuntu on Xorg" (but logging into any of the two will work)

One minor gotcha with this patch: if, with wayland enabled, one intentionally selects ubuntu-xorg, then disables wayland, then reboots, in the login screen no session is selected in the dropdown (because gdm ignored ubuntu-xorg). However this will still launch the ubuntu-xorg session by default (which effectively is the same as the ubuntu session), so all is good (except for the fact that no session appears selected in the dropdown). This has the advantage of retaining the "ubuntu-xorg" session selected by the user if wayland is re-enabled later, though.
This is a regression in the sense that no session is visually selected in the dropdown, but it doesn't affect the default session selection.

Related branches

tags: added: rls-aa-incoming
summary: - Ensure wayland -> xorg fallabck to the corresponding session
+ Ensure wayland -> xorg fallback to the corresponding session
Revision history for this message
Will Cooke (willcooke) wrote :

We don't want to commit to fixing this in time for release. It would be nice to fix, but not a release blocker.

tags: added: rls-bb-incoming
removed: rls-aa-incoming
tags: added: rls-aa-notfixing
Changed in gdm3 (Ubuntu):
assignee: nobody → Olivier Tilloy (osomon)
importance: Undecided → High
Revision history for this message
Olivier Tilloy (osomon) wrote :

I can reliably reproduce in an up-to-date artful VM. In my default session, GDMSESSION=ubuntu. If I then uncomment WaylandEnable=false in /etc/gdm3/custom.conf and reboot, the session selected by default is gnome-xorg instead of being ubuntu-xorg.

Changed in gdm3 (Ubuntu):
status: New → Confirmed
Olivier Tilloy (osomon)
Changed in gdm3 (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Olivier Tilloy (osomon) wrote :

Upstream bug report (where I requested a review): https://bugzilla.gnome.org/show_bug.cgi?id=788552

Changed in gdm:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
Olivier Tilloy (osomon) wrote :

Here is a distro-patch approach that I think is reasonable with the 17.10 final freeze in mind:

 - https://code.launchpad.net/~osomon/gdm/fix-1718446/+merge/332145
 - https://code.launchpad.net/~osomon/gnome-session/fix-1718446/+merge/332146

(the two branches are required for a complete fix).

This is trying to conform to the expectation that fallback sessions have the same desktop file name, which according to Ray (upstream gdm) is how the fallback mechanism is supposed to function.

While testing that approach, I found one minor gotcha: if, with wayland enabled, I intentionally select ubuntu-xorg, then disable wayland, then reboot, in the login screen no session is selected in the dropdown (because gdm ignored ubuntu-xorg). However this will still launch the ubuntu-xorg session by default (which effectively is the same as the ubuntu session), so all is good (except for the fact that no session appears selected in the dropdown). This has the advantage of retaining the "ubuntu-xorg" session selected by the user if wayland is re-enabled later, though.

I didn't get feedback from upstream on that approach yet, although the discussion in the upstream bug report is pointing towards more substantial changes which will require more work and won't be ready in time for 17.10. If we choose to distro-patch I will continue to work on a cleaner solution that can be upstreamed.

Changed in gdm:
status: Confirmed → Fix Released
Revision history for this message
Jeremy Bícha (jbicha) wrote :

Minor note for your minor gotcha. If gnome-session is installed, won't it instead default to GNOME instead of the Ubuntu session? (My understanding is that if it can't find the last enabled session, it uses the first session alphabetically.) In other words, doesn't this still have the same problem you mentioned in comment #2?

Revision history for this message
Olivier Tilloy (osomon) wrote :

> If gnome-session is installed, won't it instead default to GNOME
> instead of the Ubuntu session?

This is a case I tested, and no it won't default to GNOME. Under the covers it will still default to the last enabled session, in that case ubuntu-xorg (because the desktop file is there). The greeter doesn't know of that session though, so it can't tell which session is selected.

Olivier Tilloy (osomon)
description: updated
Changed in gdm3 (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Adam Conrad (adconrad) wrote : Please test proposed package

Hello Didier, or anyone else affected,

Accepted gdm3 into artful-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gdm3/3.26.1-3ubuntu3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-artful to verification-done-artful. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-artful. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed verification-needed-artful
Revision history for this message
Adam Conrad (adconrad) wrote :

Hello Didier, or anyone else affected,

Accepted gnome-session into artful-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gnome-session/3.26.1-0ubuntu6 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-artful to verification-done-artful. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-artful. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in gnome-session (Ubuntu):
status: New → Fix Committed
Revision history for this message
Jeremy Bícha (jbicha) wrote :

I installed the gdm3 (3.26.1-3ubuntu3) and gnome-session (3.26.1-0ubuntu6) packages from artful-proposed.

I tried enabling and disabling Wayland in /etc/gdm3/custom.conf and rebooting with different sessions (Ubuntu, Ubuntu on Xorg, GNOME, GNOME on Xorg). Every time I logged in after reboot I got the session I expected based on my previous login and whether Wayland was available.

tags: added: verification-done verification-done-artful
removed: verification-needed verification-needed-artful
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gdm3 - 3.26.1-3ubuntu3

---------------
gdm3 (3.26.1-3ubuntu3) artful; urgency=medium

  * debian/patches/ubuntu_ignore_sessions_xorg_suffix.patch: Ignore session
    IDs ending with "-xorg" under X11. In combination with a gnome-session
    patch, this ensures a proper fallback session is selected by gdm when
    wayland is not enabled (LP: #1718446).

 -- Olivier Tilloy <email address hidden> Wed, 11 Oct 2017 18:57:51 +0200

Changed in gdm3 (Ubuntu Artful):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for gdm3 has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-session - 3.26.1-0ubuntu6

---------------
gnome-session (3.26.1-0ubuntu6) artful; urgency=medium

  * Add symlinks in /usr/share/xsessions/:
    - gnome.desktop -> gnome-xorg.desktop
    - ubuntu.desktop -> ubuntu-xorg.desktop
    In combination with a gdm3 patch, this ensures a proper fallback session
    is selected by gdm when wayland is not enabled (LP: #1718446).

 -- Olivier Tilloy <email address hidden> Fri, 13 Oct 2017 13:33:27 +0200

Changed in gnome-session (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Khurshid Alam (khurshid-alam) wrote :

After updating to latest gdm3 and gnome session, Now Unity gives this error

"Could not apply the stored configuration for monitors." after logging-in

See screenshot: https://i.imgur.com/HrAQaL0.png

I didn't have such problems with gnome-session - 3.26.1-0ubuntu5

?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.