Can't change virtual terminal on login screen or when auto-login is enabled
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OEM Priority Project |
Fix Released
|
Critical
|
Yuan-Chen Cheng | ||
gdm3 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Bionic |
Invalid
|
Undecided
|
Unassigned | ||
plymouth (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Bionic |
Fix Released
|
Medium
|
Mauricio Faria de Oliveira | ||
Cosmic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
When AutomaticLogin is enabled in gdm3, or it is showing the login screen,
the "chvt" command blocks indefinitely (usually resumes with gdm3 restart).
This prevents users to change the foreground virtual terminal, and it can
also prevent pm-suspend to complete (as it invokes chvt).
This problem happens in Bionic; it's already fixed in Cosmic and later.
This patch to plymouth helps it not to revert the VT/tty to VT_AUTO
(after gdm calls 'plymouth deactivate' and changes it to VT_PROCESS)
which causes the ioctl(VT_SETACTIVE) not to generate the event that
the ioctl(VT_
Workarounds are to either disable plymouth / remove 'splash' from the
kernel command line or change it to use a different/
for console (console=tty0 [default] or console=tty1 [equivalent] are
affected, but console=ttyS0 or console=ttyS1 are not, being serial).
[Test case]
1) Install Bionic/18.04 LTS Desktop
2) Ensure plymouth / 'splash' is enabled (default)
$ grep splash /proc/cmdline
BOOT_IMAGE=... root=... splash ...
3) Ensure console is tty0 (default) or tty1
$ dmesg | grep console
[ 0.004000] console [tty0] enabled
A) Login screen, regardless of automatic login
4) Ensure the login screen/tty 1 is the displaying
(i.e., it's foregound/active VT) or change to it:
$ sudo chvt 1 # this works/finishes.
$
5) $ ssh <SYSTEM> 'sudo fgconsole' # check tty1 is foreground VT
1
6) $ ssh <SYSTEM> 'sudo chvt 4' # this blocks/doesn't finish
B) Automatic login, regardless of login screen
4) Enable AutomaticLogin in /etc/gdm3/
[daemon]
AutomaticL
AutomaticLogin = <YOUR_USER>
5) Reboot your system and make sure AutoLogin works by not requesting password before opening the <YOUR_USER> session.
6) Print active VT
(in Bionic, autologin user session runs on tty1)
$ sudo fgconsole
1
7) sudo chvt 4 # this blocks/doesn't finish
From SSH one can check that chvt is blocked waiting
on new VT to become active, which doesn't happen in
this case (old VT in VT_AUTO + KB_GRAPHICS mode):
$ cat /proc/$(pidof chvt)/stack
[<0>] __vt_event_
[<0>] vt_waitactive+
[<0>] vt_ioctl+
[<0>] tty_ioctl+
[<0>] do_vfs_
[<0>] SyS_ioctl+0x79/0x90
[<0>] do_syscall_
[<0>] entry_SYSCALL_
[<0>] 0xffffffffffffffff
[Potential regression]
Low. This plymouth patch is upstream and it's already applied
in Cosmic and later for ~6 months (0.9.3-1ubuntu10 / Oct 2018)
for LP: #1795637 (different problem/effect, same root cause).
Besides, it's conservative in nature, and it's spirit makes a
lot of sense (stop handling more udev events after deactivate).
There are no additional fixes to its code changes upstream.
[Original Description]
$ sudo strace chvt 4
<...>
openat(AT_FDCWD, "/dev/tty0", O_RDWR) = 3
ioctl(3, TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(3, KDGKBTYPE, 0x7ffdcdb0efa7) = 0
ioctl(3, VT_ACTIVATE, 0x4) = 0
ioctl(3, VT_WAITACTIVE, 0x4
VT_ACTIVATE will cause a switch to VT number.
VT_WAITACTIVE will sleep/wait until the specified VT has been activated.
$ sudo cat /proc/$(pidof chvt)/stack
[<0>] __vt_event_
[<0>] vt_waitactive+
[<0>] vt_ioctl+
[<0>] tty_ioctl+
[<0>] do_vfs_
[<0>] SyS_ioctl+0x79/0x90
[<0>] do_syscall_
[<0>] entry_SYSCALL_
[<0>] 0xffffffffffffffff
tags: | added: sts |
tags: | added: rls-bb-incoming |
Changed in gdm3 (Ubuntu Bionic): | |
status: | New → In Progress |
assignee: | nobody → Eric Desrochers (slashd) |
importance: | Undecided → Medium |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
Changed in linux (Ubuntu): | |
status: | Incomplete → Invalid |
Changed in linux (Ubuntu Bionic): | |
status: | Incomplete → Invalid |
Changed in gdm3 (Ubuntu): | |
status: | New → Fix Released |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
tags: | removed: rls-bb-incoming |
Changed in oem-priority: | |
importance: | Undecided → Critical |
no longer affects: | linux (Ubuntu Bionic) |
no longer affects: | linux (Ubuntu) |
Changed in gdm3 (Ubuntu): | |
importance: | Undecided → Medium |
Changed in oem-priority: | |
status: | New → Confirmed |
summary: |
- Can't change virtual terminal when auto-login is enabled + Can't change virtual terminal on login screen or when auto-login is + enabled |
Changed in gdm3 (Ubuntu): | |
status: | New → Invalid |
Changed in gdm3 (Ubuntu Bionic): | |
status: | New → Invalid |
no longer affects: | gdm3 (Ubuntu Cosmic) |
Changed in plymouth (Ubuntu Cosmic): | |
status: | New → Fix Released |
tags: | added: sts-sponsor sts-sponsor-ddstreet |
Changed in oem-priority: | |
status: | Confirmed → Fix Committed |
tags: | removed: sts-sponsor sts-sponsor-ddstreet |
tags: | added: lp-1804607 somerville |
Changed in oem-priority: | |
assignee: | nobody → Yuan-Chen Cheng (ycheng-twn) |
Changed in oem-priority: | |
status: | Fix Committed → Fix Released |
tags: | added: oem-priority |
Hmm, no idea right now.
Try turning on debugging in /etc/gdm3/ custom. conf and see if anything is outputted in the journal when you try this.
If this happens in disco, an upstream bug would be good too if you don't mind. Cheers!