"Ubuntu" and "Ubuntu on Xorg" randomly start the same session (maybe Wayland maybe Xorg)

Bug #1705157 reported by Doug McMahon
102
This bug affects 18 people
Affects Status Importance Assigned to Milestone
gdm
Fix Released
Medium
gdm3 (Ubuntu)
Fix Released
High
Iain Lane
gnome-session (Ubuntu)
Invalid
High
Unassigned

Bug Description

Test case:
Do a fresh install of current image (july 19 here
Boot up, check selected session at the greeter - it will say "ubuntu"
Log in, ck. env., it will actually be ubuntu-wayland

Ex.
$ env | grep -i wayland
DESKTOP_SESSION=ubuntu-wayland
WAYLAND_DISPLAY=wayland-0
XDG_SESSION_TYPE=wayland
XDG_SESSION_DESKTOP=ubuntu-wayland
GDMSESSION=ubuntu-wayland

Test 2:
From above log out, switch session in greeter to wayland on ubuntu,, switch back to ubuntu, login.
Now you'll be in an ubuntu session

Test 3:
log out from above ubuntu session, log into ubuntu-wayland session, reboot.
At greeter notice it says "ubuntu" selected.
Login, ck. session. You'll actually be in an ubuntu-wayland session

ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: ubuntu-session 3.24.1-0ubuntu15
ProcVersionSignature: Ubuntu 4.11.0-10.15-generic 4.11.8
Uname: Linux 4.11.0-10-generic x86_64
ApportVersion: 2.20.5-0ubuntu5
Architecture: amd64
CurrentDesktop: GNOME
Date: Tue Jul 18 21:48:10 2017
InstallationDate: Installed on 2017-07-19 (0 days ago)
InstallationMedia: Ubuntu 17.10 "Artful Aardvark" - Alpha amd64 (20170718)
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: gnome-session
UpgradeStatus: No upgrade log present (probably fresh install)

CVE References

Revision history for this message
Doug McMahon (mc3man) wrote :
Doug McMahon (mc3man)
description: updated
Revision history for this message
Doug McMahon (mc3man) wrote :

In other words the greeter will always show "ubuntu" as selected even if last session was ubuntu-wayland

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

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-session (Ubuntu):
status: New → Confirmed
Revision history for this message
corrado venturini (corradoventu) wrote :

I have the same problem on 2 installations from:
Ubuntu 17.10 "Artful Aardvark" - Alpha amd64 (20170717)
Ubuntu 17.10 "Artful Aardvark" - Alpha amd64 (20170710)
The fact i'm in wayland is confirmed because
synaptic does not start: https://bugs.launchpad.net/ubuntu/+source/synaptic/+bug/1551951
gpick does not work: https://bugs.launchpad.net/ubuntu/+source/gpick/+bug/1704808
gparted does not start: https://bugs.launchpad.net/ubuntu-gnome/+bug/1652282

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

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu:
status: New → Confirmed
Doug McMahon (mc3man)
affects: gdm → ubuntu
Changed in gdm (Ubuntu):
status: New → Confirmed
Revision history for this message
Doug McMahon (mc3man) wrote :

Note that if switching to lightdm this nonsense doesn't occur..

affects: ubuntu → gdm (Ubuntu)
Changed in gdm (Ubuntu):
status: New → Confirmed
Revision history for this message
Sebastien Bacher (seb128) wrote :

I think Didier was looking at those issues

Jeremy Bícha (jbicha)
tags: added: wayland
affects: gdm (Ubuntu) → gdm3 (Ubuntu)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I saw this happen to me a couple of weeks ago. No matter what session I selected, it always ended up using Wayland. Not sure why it stopped happening.

summary: - On fresh install or fresh boot greeter always show "ubuntu" though
- selected session may be ubuntu-wayland
+ Both "Ubuntu" and "Ubuntu on Wayland" result in Wayland. No way to use
+ X11.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Reverting the summary, because it's not wayland/non wayland. Like you can select the ubuntu session and GNOME will be selected, both being X. So it's rather "you select a session, another one is selected".

summary: - Both "Ubuntu" and "Ubuntu on Wayland" result in Wayland. No way to use
- X11.
+ On fresh install or fresh boot greeter always show "ubuntu" though
+ selected session may be ubuntu-wayland
Revision history for this message
corrado venturini (corradoventu) wrote :

still with: Ubuntu 17.10 "Artful Aardvark" - Alpha amd64 (20170807)
corrado@corrado-HP-aa-0806:~$ inxi -GxxIS
System: Host: corrado-HP-aa-0806 Kernel: 4.11.0-10-generic x86_64 (64 bit gcc: 6.3.0)
           Desktop: Gnome 3.24.3 (Gtk 3.22.17-0ubuntu1) dm: gdm3
           Distro: Ubuntu Artful Aardvark (development branch)
Graphics: Card: Intel Haswell-ULT Integrated Graphics Controller
           bus-ID: 00:02.0 chip-ID: 8086:0a16
           Display Server: wayland (X.Org 1.19.3) driver: i915
           Resolution: 1366x768@59.80hz
           OpenGL: renderer: Mesa DRI Intel Haswell Mobile
           version: 4.5 Mesa 17.1.4 (compat-v: 3.0) Direct Render: Yes
Info: Processes: 239 Uptime: 2:56 Memory: 1608.2/3881.3MB
           Init: systemd v: 233 runlevel: 5 Gcc sys: N/A
           Client: Shell (bash 4.4.121 running in gnome-terminal-) inxi: 2.3.25
corrado@corrado-HP-aa-0806:~$

Revision history for this message
Doug McMahon (mc3man) wrote :

Fixed by going to the default of wayland, option of xorg

Changed in gdm3 (Ubuntu):
status: Confirmed → Fix Released
Changed in gnome-session (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Doug, that's just a workaround really.

For those of us who want/need a Xorg session then this bug persists. You might think you've selected the Xorg session but get the Wayland session instead.

Changed in gdm3 (Ubuntu):
status: Fix Released → Confirmed
Changed in gnome-session (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

@Daniel: do you really reproduce similar bug that way now that the priority gdm list is reverse? (see the removed patch). C

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Oh, Doug and Didier might be right. If the change happened in the past day or two then it may have fixed it, and I'm thinking about laptops that haven't been updated this week.

Changed in gdm3 (Ubuntu):
status: Confirmed → Fix Released
Changed in gnome-session (Ubuntu):
status: Confirmed → Fix Released
Doug McMahon (mc3man)
Changed in gnome-session (Ubuntu):
status: Fix Released → New
Revision history for this message
Doug McMahon (mc3man) wrote :

Well, not exactly fixed...
From an upgrade perspective it is fixed.
In general extended use it's fixed.

But from a fresh install -
The 1st. login will show "ubuntu" as selected session but in actuality it will be a ubuntu-xorg session.
Again simply switching the login options fixes & unlike before issue won't reappear.

Maybe this comes from installing from a live session which is ubuntu-xorg?
(- haven't tried a direct install from usb install media..

Revision history for this message
Doug McMahon (mc3man) wrote :

I take some of that back.
Just did a fresh install of todays image.
It's completely screwed up again, only difference is now you get ubuntu-xorg when it says ubuntu

If nned be could systematically go thru for test cases but seems pretty evident..

Changed in gdm3 (Ubuntu):
status: Fix Released → New
Revision history for this message
Doug McMahon (mc3man) wrote :

A bit different than before.

1. On fresh install 1st. login, says "ubuntu" but session is xorg
2. If switching once back & forth then "ubuntu' correctly produces wayland
3. Whatever session is logged into then a log out/in shows & produces that session, i.e. completely correct.
4. A reboot again always shows "ubuntu" but session will be whatever it was at shutdown/restart

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

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gdm3 (Ubuntu):
status: New → Confirmed
Changed in gnome-session (Ubuntu):
status: New → Confirmed
Revision history for this message
Christophe C (batra3) wrote :

1. On fresh install 1st. login, says "ubuntu" but session is xorg
2. i quit the session and login under "Ubuntu" => xorg
3. I leave the session and login under Ubuntu Xorg => xorg
4. I deconnect the session and login under "Ubuntu" => Wayland

summary: - On fresh install or fresh boot greeter always show "ubuntu" though
- selected session may be ubuntu-wayland
+ "Ubuntu" and "Ubuntu on Xorg" randomly start the same session (maybe
+ Wayland maybe Xorg)
Changed in gdm3 (Ubuntu):
importance: Undecided → High
Changed in gnome-session (Ubuntu):
importance: Undecided → High
Changed in gnome-session:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
Khurshid Alam (khurshid-alam) wrote :

Looks like same as bug #1714876

Revision history for this message
Khurshid Alam (khurshid-alam) wrote :

If I install lightdm and reboot into lightdm all the sessions are clearly visible including Gnome, Ubuntu on xorg etc and they work as the name say.

Revision history for this message
Doug McMahon (mc3man) wrote :

Don't see any randomness to this at all. The current behavior seen here on a Fresh install of Mondays image updated -
1st. login after install is always to an ubuntu-xorg session

The login greeter will Always says "ubuntu" no matter what.

Subsequent logins from a reboot or cold boot are always to the session one exited from previously.

Logging out then in to the other session can produce some mixed info though the session will be what's picked. Possibly the mixed info is unimportant?

Note that if on an ubuntu-xorg session because the greeter Always says ubuntu to actually get an ubuntu session one must switch in greeter from ubuntu to ubuntu-xorg & back to ubuntu

Examples of mixed info from log out session switching:

Log out from ubuntu-xorg to an actual ubuntu session.

~$ echo $DESKTOP_SESSION
ubuntu

$ env |grep wayland
WAYLAND_DISPLAY=wayland-0
XDG_SESSION_TYPE=wayland

$ env |grep xorg
XDG_DATA_DIRS=/usr/share/ubuntu-xorg:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu-xorg:/etc/xdg

Log out from an actual ubuntu session to an ubuntu-xorg session.

$ echo $DESKTOP_SESSION
ubuntu-xorg

$ env |grep wayland
WAYLAND_DISPLAY=wayland-0
$ env |grep xorg

DESKTOP_SESSION=ubuntu-xorg
XDG_DATA_DIRS=/usr/share/ubuntu-xorg:/usr/share/ubuntu-xorg:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop:/var/lib/snapd/desktop
XDG_SESSION_DESKTOP=ubuntu-xorg
GDMSESSION=ubuntu-xorg
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu-xorg:/etc/xdg/xdg-ubuntu-xorg:/etc/xdg

Restarts produce different info

Restart from an actual ubuntu session

$ echo $DESKTOP_SESSION
ubuntu
$ env |grep wayland
WAYLAND_DISPLAY=wayland-0
XDG_SESSION_TYPE=wayland
$ env |grep xorg

Restart from an ubuntu-xorg session.

$ echo $DESKTOP_SESSION
ubuntu-xorg
$ env |grep xorg
DESKTOP_SESSION=ubuntu-xorg
XDG_DATA_DIRS=/usr/share/ubuntu-xorg:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
XDG_SESSION_DESKTOP=ubuntu-xorg
GDMSESSION=ubuntu-xorg
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu-xorg:/etc/xdg
$ env |grep wayland

Revision history for this message
SB (emehntehtt) wrote :

I have this problem as well, I installed a fresh daily image and I have Ubuntu and Ubuntu on X.org sessions, but when I choose Ubuntu which should work on Wayland there is no Wayland and X.org is running.

Revision history for this message
Sebastien Bacher (seb128) wrote :

the mixed env could be https://bugzilla.gnome.org/show_bug.cgi?id=777669

here on a new install ubuntu gives a wayland session

Revision history for this message
Doug McMahon (mc3man) wrote : Re: [Bug 1705157] Re: "Ubuntu" and "Ubuntu on Xorg" randomly start the same session (maybe Wayland maybe Xorg)

On 09/07/2017 02:50 AM, Sebastien Bacher wrote:
> the mixed env could be https://bugzilla.gnome.org/show_bug.cgi?id=777669
>
> here on a new install ubuntu gives a wayland session
>
> ** Bug watch added: GNOME Bug Tracker #777669
> https://bugzilla.gnome.org/show_bug.cgi?id=777669
>
Here on fresh install of 09/06 image the 1st login after install is to
xorg. (says ubuntu but that's the constant, always says ubuntu.
(-I wouldn't doubt if one was to install gnome-session it may then
always say gnome
As far as mixed env - it's becoming quite clear that gdm requires
restarts for many things that in lightdm a log out would suffice.
(- simple example could be to install gnome-session then log out/in &
see what happens.

Revision history for this message
Khurshid Alam (khurshid-alam) wrote :

Does this bug related to this? bug #1697882....

Because I disabled 95_hide_x11_sessions_with_nvidia_kms.patch and everything started working well.

On non-nvidia machine, non-hybrid machine, when I try live iso,

a) Ubuntu logs into wayland
b) Ubuntu-on-xorg logs into xorg as expected.

I don't like the check that patch implements. It manually checks for modules in "/proc/modules"

is_module_loaded (const char *module) {
.....
.....

const char *modules_file = "/proc/modules";

file = fopen (modules_file, "r");
if (!file) {
     g_debug ("Failed to parse %s\n", modules_file);
     return status;
}

And my guess is for some reason it fails to detect intel for hybrid machine at

/* Let's leave hybrid graphics alone */
 if (is_module_loaded ("i915")) {
         g_debug ("is_nvidia_kms_available: Intel detected, doing nothing.\n");
         goto end;
 }

But then it could be just me. Does disabling the above patch solve the problem?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Interesting thought, but we were seeing this bug two months before the fix for bug 1697882 existed.

I too had suffered from this bug in the past but don't seem to at all now.

Revision history for this message
Doug McMahon (mc3man) wrote :

Fresh install on image of 09/10 updated, an nvidia hybrid laptop, nothing has changed.
1. 1st login from install uses xorg
2. All logins always say "ubuntu"
3. No matter what session is exited from #2 remains always true

So with above being true, at best a user does an install, logs in & is using xorg. They may or may not check the reported session by clicking on that little login screen icon.
If they were expecting wayland then the impression would be 'it works pretty good' (wonder why?
They may never change sessions from the login screen so will continue to use xorg.

Or they may open the login options, see xorg & decide to see how that works compared to 'pseudo wayland' Again everything will work fine, may seem like not much difference between wayland & xorg (wonder why?

Only when users happen to switch back & forth will they actually get wayland & for some, things that initially worked won't..

Now maybe? this only affects a certain subset of hardware but that will not be an insignificant number.

Revision history for this message
Doug McMahon (mc3man) wrote :

So really the biggest issue is #2 from above, the login screen needs to report the actual session to be used from 1st login on.
That still doesn't address advertising that wayland is the default in 17.10 (but not in the first default session), but does eliminate a lot of subsequent misleadings.

Revision history for this message
Iain Lane (laney) wrote :

I'm looking at the "first login gives the wrong session" bug. I can reproduce in a VM that it says "Ubuntu" but you get "Ubuntu on X" (or whatever the exact name is).

In this case GDM is using the "fallback" (default) session. It is set to ubuntu-xorg despite ubuntu being valid, being the first in the list and being selected in the UI. I think there might be a difference in sorting between the UI's presentation of sessions and the selection of fallback sessions - that's what I'm about to start investigating.

Changed in gnome-session (Ubuntu):
status: Confirmed → In Progress
status: In Progress → Invalid
Changed in gdm3 (Ubuntu):
status: Confirmed → In Progress
assignee: nobody → Iain Lane (laney)
Revision history for this message
Iain Lane (laney) wrote :

Something like

@@ -576,9 +582,15 @@
                                 continue;
                         }

+ g_debug ("considering %s", base_name);
                         if (get_session_command_for_file (self, base_name, NULL)) {
-
- g_sequence_insert_sorted (sessions, g_strdup (base_name), (GCompareDataFunc) g_strcmp0, NULL);
+ g_debug ("yes, adding");
+ name = g_strndup (base_name,
+ strlen (base_name) -
+ strlen (".desktop"));
+ g_sequence_insert_sorted (sessions, name, (GCompareDataFunc) g_strcmp0, NULL);
+ } else {
+ g_debug ("no, not adding");
                         }
                 } while (base_name != NULL);

@@ -589,25 +601,22 @@
         name = NULL;
         session = g_sequence_get_begin_iter (sessions);

+ g_debug ("iterating the GSequence");
+
         if (g_sequence_iter_is_end (session))
                 g_error ("GdmSession: no session desktop files installed, aborting...");

         do {
                if (g_sequence_get (session)) {
- char *base_name;
-
- g_free (name);
- base_name = g_sequence_get (session);
- name = g_strndup (base_name,
- strlen (base_name) -
- strlen (".desktop"));
-
+ name = g_sequence_get (session);
+ g_debug ("iter: looking at %s", name);
                        break;
                }
                session = g_sequence_iter_next (session);
         } while (!g_sequence_iter_is_end (session));

         g_free (self->priv->fallback_session_name);
+ g_debug ("setting fallback_session_name to: %s", name);
         self->priv->fallback_session_name = name;

         g_sequence_free (sessions);

makes it start the ubuntu (wayland) session, but then GDM is constantly restarting in a loop. Could just be some weirdness in my VM, looking.

tags: added: rls-aa-incoming
Revision history for this message
Iain Lane (laney) wrote :

No. I suck. It's because we free the GSequence, but the string is referenced in self->priv->fallback_session_name. strdup it when it goes in there. Then we have DESKTOP_SESSION=ubuntu.

Changed in gnome-session:
status: Confirmed → Fix Released
affects: gnome-session → gdm
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (4.1 KiB)

This bug was fixed in the package gdm3 - 3.26.0-1ubuntu1

---------------
gdm3 (3.26.0-1ubuntu1) artful; urgency=medium

  * Merge with Debian. Remaining changes:
    + README.Debian: update for correct paths in Ubuntu
    + control.in:
      - Don't recommend desktop-base
      - Depend on bash for ubuntu_config_error_dialog.patch
      - Update Vcs field
      - Don't build for s390x since gnome-shell isn't available there
    + rules:
      - Don't override default user/group
      - --enable-gdm-xsession to install upstream Xsession script
      - override dh_installinit with --no-start to avoid session being killed
      - Only do gdm3 things when we're building gdm3
    + rules, README.Debian, gdm3.8.pod:
      Use upstream custom.conf instead of daemon.conf
    + gdm3.{postinst,postrm}: rename user and group back to gdm
    + gdm3.postinst: don't kill gdm on upgrade
    + gdm3.*.pam: Make pam_env read ~/.pam_environment (LP: #952185)
    + gdm3.install:
      - Stop installing default.desktop. It adds unnecessary clutter
        ("System Default") to the session chooser.
      - Don't install debian/Xsession
    + debian/gdm3.config
      - Only prompt the user to choose display managers when we haven't
        already determined a migration to gdm3 is recommended.
      - Handle the transition from lightdm in gdm3 rather than
        ubuntu-session
      - Check the version of gdm3 instead of ubuntu-session. If
        ubuntu-session wasn't installed, the previous version generated
        stderr output. (It didn't fail, because the dpkg-query call was
        first in the pipeline and the awk call always succeeds.) If gdm3
        was configured before ubuntu-session then this check wouldn't have
        worked either. I think that instead we can compare the version of
        gdm3 itself, and do this transition when we upgrade from an old
        version or install gdm3 for the first time.
    + ubuntu_run_xsession.d.patch
    + ubuntu_xresources_is_a_dir.patch
      - Fix loading from /etc/X11/Xresources/*
    + ubuntu_nvidia_prime.patch:
      - Add hook to run prime-offload (as root) and prime-switch if
        nvidia-prime is installed (LP: #1262068)
    + revert_override_LANG_with_accountservices.patch:
      - On Ubuntu accountservices only stores the language and not the
        full locale as needed by LANG.
    + ubuntu_config_error_dialog.patch:
      - Show warning dialog in case of error in ~/.profile etc. and
        don't let a syntax error make the login fail (LP: #678421).
    + Add revert_drop_gdm_shell_session.patch:
      - Revert commit that requires gnome-session to be installed
    + debian/default.pa
      - Added new file to disable Bluetooth audio devices in PulseAudio from
        gdm3.
    + debian/gdm3.install
      - Added details of the default.pa file
    + debian/gdm3.postinst
      - Added installation of default.pa and creation of dir if it doesn't
        exist.
    + debian/patches/95_hide_x11_sessions_with_nvidia_kms.patch: Patch from
      Alberto Milone. On nvidia, if the user has enabled KMS, don't show X11
      sessions and force Wayland instead since X11 won't work there.

gdm3 (3.26.0-1) u...

Read more...

Changed in gdm3 (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Camille Guay (f-rog) wrote :

So I was doing some stuff needing me to be on X11..
And randomly on a startup booted up onto wayland.
I confirmed the setting was already set to boot on X11.
So I reboot and it didn't change anything and I had to "sudo systemctl restart gdm3".
Ubuntu 22.10 freshly installed.
Had this bug happen to me earlier in something like 2022.
I think the bug is back ?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

That's likely a *feature* in that the session type changes automatically if the first choice crashed or failed to start for some reason.

Regardless, this bug has been closed for over 5 years so shouldn't be recycled. Please open new bugs about any concerns you have.

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.