[Bug 1817738] Re: Can't change virtual terminal on login screen or when auto-login is enabled
I'm seeing this same issue (hung syscall on VT) from systemd-sleep on a suspend operation with Xubuntu (and therefore lightdm). I see a similar stack-trace too. 18.04 with 4.15.0-56-lowlatency. https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1744370 apt list plymouth Listing... Done plymouth/bionic-updates,now 0.9.3-1ubuntu7.18.04.2 amd64 [installed,automatic] $ sudo cat /proc/$(pidof systemd-sleep)/stack [<0>] __vt_event_wait.isra.2.part.3+0x40/0x90 [<0>] vt_waitactive+0x7b/0xd0 [<0>] vt_move_to_console+0x46/0xc0 [<0>] pm_prepare_console+0x23/0x40 [<0>] pm_suspend+0x19c/0x3b0 [<0>] state_store+0x85/0xf0 [<0>] kobj_attr_store+0x12/0x20 [<0>] sysfs_kf_write+0x3c/0x50 [<0>] kernfs_fop_write+0x125/0x1a0 [<0>] __vfs_write+0x1b/0x40 [<0>] vfs_write+0xb1/0x1a0 [<0>] SyS_write+0x55/0xc0 [<0>] do_syscall_64+0x73/0x130 [<0>] entry_SYSCALL_64_after_hwframe+0x3d/0xa2 [<0>] 0x -- You received this bug notification because you are a member of Ubuntu Desktop Bugs, which is subscribed to gdm3 in Ubuntu. https://bugs.launchpad.net/bugs/1817738 Title: Can't change virtual terminal on login screen or when auto-login is enabled To manage notifications about this bug go to: https://bugs.launchpad.net/oem-priority/+bug/1817738/+subscriptions -- desktop-bugs mailing list desktop-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/desktop-bugs
[Bug 1817738] Re: Can't change virtual terminal on login screen or when auto-login is enabled
** Tags added: oem-priority -- You received this bug notification because you are a member of Ubuntu Desktop Bugs, which is subscribed to gdm3 in Ubuntu. https://bugs.launchpad.net/bugs/1817738 Title: Can't change virtual terminal on login screen or when auto-login is enabled To manage notifications about this bug go to: https://bugs.launchpad.net/oem-priority/+bug/1817738/+subscriptions -- desktop-bugs mailing list desktop-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/desktop-bugs
[Bug 1817738] Re: Can't change virtual terminal on login screen or when auto-login is enabled
** Changed in: oem-priority Status: Fix Committed => Fix Released -- You received this bug notification because you are a member of Ubuntu Desktop Bugs, which is subscribed to gdm3 in Ubuntu. https://bugs.launchpad.net/bugs/1817738 Title: Can't change virtual terminal on login screen or when auto-login is enabled To manage notifications about this bug go to: https://bugs.launchpad.net/oem-priority/+bug/1817738/+subscriptions -- desktop-bugs mailing list desktop-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/desktop-bugs
[Bug 1817738] Re: Can't change virtual terminal on login screen or when auto-login is enabled
** Tags added: lp-1804607 somerville ** Changed in: oem-priority Assignee: (unassigned) => Yuan-Chen Cheng (ycheng-twn) -- You received this bug notification because you are a member of Ubuntu Desktop Bugs, which is subscribed to gdm3 in Ubuntu. https://bugs.launchpad.net/bugs/1817738 Title: Can't change virtual terminal on login screen or when auto-login is enabled To manage notifications about this bug go to: https://bugs.launchpad.net/oem-priority/+bug/1817738/+subscriptions -- desktop-bugs mailing list desktop-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/desktop-bugs
[Bug 1817738] Re: Can't change virtual terminal on login screen or when auto-login is enabled
This bug was fixed in the package plymouth - 0.9.3-1ubuntu7.18.04.2 --- plymouth (0.9.3-1ubuntu7.18.04.2) bionic; urgency=medium [ Mauricio Faria de Oliveira ] * d/p/0013-device-manager-don-t-watch-for-udev-events-when-deac_bionic.patch: - Don't process udev events after we've been deactivated (e.g., by gdm). These can cause the VT/tty to be set back to VT_AUTO mode after it's set to VT_PROCESS mode (by gdm), which blocks 'chvt' indefinitely on that VT (login screen or auto-login session in tty1). (LP: #1817738) [ Brian Murray ] * debian/patches/git_helper_renderer.patch, debian/patches/git_desactivate_renderer.patch: - 'device-manager: free keyboards when deactivating a renderer', (LP: #1794292) -- Dan Streetman Thu, 04 Apr 2019 11:41:18 -0400 ** Changed in: plymouth (Ubuntu Bionic) Status: Fix Committed => Fix Released -- You received this bug notification because you are a member of Ubuntu Desktop Bugs, which is subscribed to gdm3 in Ubuntu. https://bugs.launchpad.net/bugs/1817738 Title: Can't change virtual terminal on login screen or when auto-login is enabled To manage notifications about this bug go to: https://bugs.launchpad.net/oem-priority/+bug/1817738/+subscriptions -- desktop-bugs mailing list desktop-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/desktop-bugs
[Bug 1817738] Re: Can't change virtual terminal on login screen or when auto-login is enabled
** Tags removed: sts-sponsor sts-sponsor-ddstreet -- You received this bug notification because you are a member of Ubuntu Desktop Bugs, which is subscribed to gdm3 in Ubuntu. https://bugs.launchpad.net/bugs/1817738 Title: Can't change virtual terminal on login screen or when auto-login is enabled To manage notifications about this bug go to: https://bugs.launchpad.net/oem-priority/+bug/1817738/+subscriptions -- desktop-bugs mailing list desktop-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/desktop-bugs
[Bug 1817738] Re: Can't change virtual terminal on login screen or when auto-login is enabled
** Changed in: oem-priority Status: Confirmed => Fix Committed -- You received this bug notification because you are a member of Ubuntu Desktop Bugs, which is subscribed to gdm3 in Ubuntu. https://bugs.launchpad.net/bugs/1817738 Title: Can't change virtual terminal on login screen or when auto-login is enabled To manage notifications about this bug go to: https://bugs.launchpad.net/oem-priority/+bug/1817738/+subscriptions -- desktop-bugs mailing list desktop-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/desktop-bugs
[Bug 1817738] Re: Can't change virtual terminal on login screen or when auto-login is enabled
Verification successful with bionic-proposed. Tested in login screen and auto-login session; repeated 5 times with consistent results. bionic-updates -- $ dpkg -s plymouth | grep ^Version: Version: 0.9.3-1ubuntu7.18.04.1 $ grep -wo splash /proc/cmdline splash $ dmesg | grep console [0.004000] console [tty0] enabled $ sudo fgconsole 1 $ sudo chvt 4 ^C # blocked. $ sudo strace -e ioctl chvt 4 <...> ioctl(3, VT_ACTIVATE, 0x4) = 0 ioctl(3, VT_WAITACTIVE, 0x4 ^C)= -1 EINTR (Interrupted system call) strace: Process 1518 detached bionic-proposed --- $ dpkg -s plymouth | grep ^Version: Version: 0.9.3-1ubuntu7.18.04.2 $ grep -wo splash /proc/cmdline splash $ dmesg | grep console [0.004000] console [tty0] enabled $ sudo fgconsole 1 $ sudo chvt 4 $ # finished. ** Tags removed: verification-needed verification-needed-bionic ** Tags added: verification-done verification-done-bionic -- You received this bug notification because you are a member of Ubuntu Desktop Bugs, which is subscribed to gdm3 in Ubuntu. https://bugs.launchpad.net/bugs/1817738 Title: Can't change virtual terminal on login screen or when auto-login is enabled To manage notifications about this bug go to: https://bugs.launchpad.net/oem-priority/+bug/1817738/+subscriptions -- desktop-bugs mailing list desktop-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/desktop-bugs
[Bug 1817738] Re: Can't change virtual terminal on login screen or when auto-login is enabled
Hello Eric, or anyone else affected, Accepted plymouth into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/plymouth/0.9.3-1ubuntu7.18.04.2 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-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed. Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping! N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days. ** Changed in: plymouth (Ubuntu Bionic) Status: In Progress => Fix Committed ** Tags removed: verification-failed verification-failed-bionic ** Tags added: verification-needed verification-needed-bionic -- You received this bug notification because you are a member of Ubuntu Desktop Bugs, which is subscribed to gdm3 in Ubuntu. https://bugs.launchpad.net/bugs/1817738 Title: Can't change virtual terminal on login screen or when auto-login is enabled To manage notifications about this bug go to: https://bugs.launchpad.net/oem-priority/+bug/1817738/+subscriptions -- desktop-bugs mailing list desktop-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/desktop-bugs
[Bug 1817738] Re: Can't change virtual terminal on login screen or when auto-login is enabled
https://launchpad.net/ubuntu/+source/gdm3/+publishinghistory Deleted Bionic proposedmaingnome 3.28.3-0ubuntu18.04.5 -- You received this bug notification because you are a member of Ubuntu Desktop Bugs, which is subscribed to gdm3 in Ubuntu. https://bugs.launchpad.net/bugs/1817738 Title: Can't change virtual terminal on login screen or when auto-login is enabled To manage notifications about this bug go to: https://bugs.launchpad.net/oem-priority/+bug/1817738/+subscriptions -- desktop-bugs mailing list desktop-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/desktop-bugs
[Bug 1817738] Re: Can't change virtual terminal on login screen or when auto-login is enabled
** Also affects: gdm3 (Ubuntu) Importance: Undecided Status: New ** Changed in: gdm3 (Ubuntu) Status: New => Invalid ** Changed in: gdm3 (Ubuntu Bionic) Status: New => Invalid ** Also affects: plymouth (Ubuntu Cosmic) Importance: Undecided Status: New ** Also affects: gdm3 (Ubuntu Cosmic) Importance: Undecided Status: New ** No longer affects: gdm3 (Ubuntu Cosmic) ** Changed in: plymouth (Ubuntu Cosmic) Status: New => Fix Released -- You received this bug notification because you are a member of Ubuntu Desktop Bugs, which is subscribed to gdm3 in Ubuntu. https://bugs.launchpad.net/bugs/1817738 Title: Can't change virtual terminal on login screen or when auto-login is enabled To manage notifications about this bug go to: https://bugs.launchpad.net/oem-priority/+bug/1817738/+subscriptions -- desktop-bugs mailing list desktop-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/desktop-bugs
[Bug 1817738] Re: Can't change virtual terminal on login screen or when auto-login is enabled
Thanks for checking and fixing up this, Eric and Dan. :) -- You received this bug notification because you are a member of Ubuntu Desktop Bugs, which is subscribed to gdm3 in Ubuntu. https://bugs.launchpad.net/bugs/1817738 Title: Can't change virtual terminal on login screen or when auto-login is enabled To manage notifications about this bug go to: https://bugs.launchpad.net/oem-priority/+bug/1817738/+subscriptions -- desktop-bugs mailing list desktop-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/desktop-bugs
[Bug 1817738] Re: Can't change virtual terminal on login screen or when auto-login is enabled
** Tags added: sts-sponsor sts-sponsor-ddstreet -- You received this bug notification because you are a member of Ubuntu Desktop Bugs, which is subscribed to gdm3 in Ubuntu. https://bugs.launchpad.net/bugs/1817738 Title: Can't change virtual terminal on login screen or when auto-login is enabled To manage notifications about this bug go to: https://bugs.launchpad.net/oem-priority/+bug/1817738/+subscriptions -- desktop-bugs mailing list desktop-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/desktop-bugs
[Bug 1817738] Re: Can't change virtual terminal on login screen or when auto-login is enabled
** Patch added: "plymouth_bionic.debdiff" https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1817738/+attachment/5252486/+files/plymouth_bionic.debdiff ** Also affects: plymouth (Ubuntu) Importance: Undecided Status: New ** Changed in: plymouth (Ubuntu) Status: New => Confirmed ** Changed in: plymouth (Ubuntu) Importance: Undecided => Medium ** No longer affects: gdm3 (Ubuntu) ** No longer affects: gdm3 (Ubuntu Bionic) ** Changed in: plymouth (Ubuntu) Status: Confirmed => Fix Released ** Also affects: plymouth (Ubuntu Bionic) Importance: Undecided Status: New ** Changed in: plymouth (Ubuntu Bionic) Status: New => In Progress ** Changed in: plymouth (Ubuntu Bionic) Importance: Undecided => Medium ** Changed in: plymouth (Ubuntu Bionic) Assignee: (unassigned) => Mauricio Faria de Oliveira (mfo) -- You received this bug notification because you are a member of Ubuntu Desktop Bugs, which is subscribed to gdm3 in Ubuntu. https://bugs.launchpad.net/bugs/1817738 Title: Can't change virtual terminal on login screen or when auto-login is enabled To manage notifications about this bug go to: https://bugs.launchpad.net/oem-priority/+bug/1817738/+subscriptions -- desktop-bugs mailing list desktop-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/desktop-bugs
[Bug 1817738] Re: Can't change virtual terminal on login screen or when auto-login is enabled
The root cause of this problem is plymouth, indeed. The 'chvt N' command blocks if the VT/tty is in VT_AUTO + KD_GRAPHICS state. In this state the kernel bails out early in the ioctl(VT_ACTIVATE) syscall and does not post the VT_EVENT_SWITCH event the ioctl(VT_WAITACTIVE) syscall will be waiting for -- causing chvt to block. The function path is: vt_ioctl(tty0, VT_ACTIVATE, ...) -> set_console() -> if (... VT_AUTO && KD_GRAPHICS ...) return -EINVAL; <<-- bails out. -> schedule_console_callback(); return 0; <<-- continue to send event. -> console_callback() -> change_console() -> complete_change_console() -> vt_event_post(VT_EVENT_SWITCH, ...) vt_ioctl(tty0, VT_WAITACTIVE, ...) -> vt_waitactive() -> __vt_event_wait(VT_EVENT_SWITCH) <<-- blocks/wait to receive event. gdm properly sets the VT out of VT_AUTO mode (which causes chvt not to block) after it tells plymouth to deactivate. BUT plymouth can set it back to VT_AUTO mode afterward, regardless, while it handles the udev event of the DRM/DRI graphics card addition, as that causes the VT/tty to be reconfigured. This can be verified with plymouth debugging, e.g., kernel boot option 'plymouth.debug=file:/run/plymouth.debug', plus source code inspection: 1) gdm calls 'plymouth deactivate', which calls ply_terminal_close() -> ply_terminal_stop_watching_for_vt_changes() -> if (terminal->is_watching_for_vt_changes == true) ioctl(VT_SETMODE, VT_AUTO) -> terminal->is_watching_for_vt_changes = false [ply-boot-server.c:LINE] print_connection_process_identity:connection is from pid PID (/bin/plymouth deactivate) with parent pid PID (/usr/sbin/gdm) ... [ply-terminal.c:LINE]ply_terminal_close:restoring color palette [ply-terminal.c:LINE]ply_terminal_close:stop watching tty fd ... 2) plymouth udev event timeout expires, it notices the DRM/DRI devices, and re-enables the VT watching while processing those; in the calls: ply_terminal_open() -> ply_terminal_watch_for_vt_changes() -> terminal->is_watching_for_vt_changes = true; [ply-device-manager.c:LINE] create_devices_from_udev:Timeout elapsed, looking for devices from udev ... [ply-device-manager.c:LINE] create_devices_for_terminal_and_renderer_type:creating devices for /dev/dri/card0 (renderer type: 1) (terminal: /dev/tty1) ... [./plugin.c:LINE] load_driver:Opening '/dev/dri/card0' [ply-terminal.c:LINE] ply_terminal_open:trying to open terminal '/dev/tty1' 3) init calls 'plymouth quit --retain-splash' which goes into ply_terminal_close() again, and since watching is true, it sets the VT into VT_AUTO again (see calls in #1 above) ... (*after* gdm had already set the VT up out of VT_AUTO). [ply-boot-server.c:LINE] print_connection_process_identity:connection is from pid PID (/bin/plymouth quit --retain-splash) with parent pid PID (/sbin/init splash) ... [ply-terminal.c:LINE]ply_terminal_close:restoring color palette [ply-terminal.c:LINE]ply_terminal_close:stop watching tty fd That depends on timing (plymouth udev event watch timeout + device detection) and this probably explains why the problem does not happen every single time (but apparently it's the case often; the problem reproduces most of the time in this KVM guest with Ubuntu 18.04.2 Desktop). After understanding that this behavior / code path is responsible for the problem, I found there's an upstream for this in plymouth, which realizes that after 'plymouth deactivate' the udev events should not be reacted on, which prevents re-setting the VT_AUTO mode. Interestingly this fix is already applied in Ubuntu Cosmic and later, for LP: #1795637, due to a different problem (cayses wayland/xorg to fail). The patch needed just a small refresh to apply to Bionic, and a test kernel with it applied successfully passes all 'chvt' tests, multiple times. 1) While gdm is in the login screen, 'ssh -- sudo chvt 4' 2) With gdm autologin, try the same. Possible workarounds for this are disabling plymouth (remove the 'splash' option from kernel/grub boot options) OR setting the kernel console to a device other than tty0/tty1 (check it with 'dmesg | grep console'), for example, console=ttyS0 or console=ttyS1 (serial/non-graphic consoles). This causes plymouth not to mess with the VT used by gdm (a graphic one). ** Description changed: [Impact] - When AutomaticLogin is enable in gdm3. The "chvt" command hangs forever, - preventing from changing foreground virtual terminal. + 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
[Bug 1817738] Re: Can't change virtual terminal on login screen or when auto-login is enabled
** Summary changed: - Can't change virtual terminal when auto-login is enabled + Can't change virtual terminal on login screen or when auto-login is enabled -- You received this bug notification because you are a member of Ubuntu Desktop Bugs, which is subscribed to gdm3 in Ubuntu. https://bugs.launchpad.net/bugs/1817738 Title: Can't change virtual terminal on login screen or when auto-login is enabled To manage notifications about this bug go to: https://bugs.launchpad.net/oem-priority/+bug/1817738/+subscriptions -- desktop-bugs mailing list desktop-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/desktop-bugs