After upgrade 20.04 LTS -> 23.10, closing laptop lid causes all GUI apps to be quit

Bug #2039731 reported by Andi McClure
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I have a brand new Lenovo ThinkPad T14 (AMD) Gen 3 with touchscreen. I was told this is a good laptop for Linux and Lenovo says it is "certified" on Ubuntu 20.04.

Yesterday I installed Ubuntu 22.04 LTS off a USB stick. It worked pretty well. Later in the day I decided to upgrade to a newer Ubuntu and installed Ubuntu 23.10 off a USB stick (I did not upgrade, I told it to delete the partition and create a new one). This has had a couple new, serious problems (see also https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/2039722 ).

With 23.10 I am seeing a behavior where if I close the lid, wait for the red light on the Thinkpad logo to begin blinking to indicate it is in sleep, then open the lid, it asks me to log in, and when I log in I am looking at a new, blank desktop session. All my apps have been quit. I see this behavior both when I am plugged into power and when I am not plugged into power. I am 95% certain I did not see this yesterday in 22.04 LTS. I closed and reopened the laptop multiple times.

I have made fumbling attempts to fix this myself but because this is a common laptop, Lenovo-certified with Ubuntu, with default settings, and I *THINK* it is a regression (seemed to work with 22.04 LTS?) I think it should work out of the box.

MY FUMBLING ATTEMPTS TO FIX THIS MYSELF

I learned Linux on servers and before the systemd era. I do not currently know how to find out: - Where is there a log of which applications have crashed, and when? - Where is there a log of reboots? On Windows there is an "event viewer" which tells you the last reboot (and whether it was caused by a power event, the OS or user requesting the reboot, or what). At the moment I don't know in Linux if it is trying to hibernate and failing, intentionally powering down, or if it is correctly hibernating and waking but at some step a critical software (like the wayland server) is dying. I am happy to gather any information needed.

The Arch wiki, which in my experience is often a good source of general Linux information, has a page on this device https://wiki.archlinux.org/title/Lenovo_ThinkPad_T14_(AMD)_Gen_3 containing the suspicious line:

"According to Lenovo staff the CPU generation in this device only supports s2idle and not S3 sleep."

They recommend running: $ cat /sys/power/mem_sleep to see what suspend methods are "advertised". This file contains only the line "[s2idle]". The arch wiki says that "shallow" or "deep" should be next to s2idle and I want to pick one of them. But I don't see either of those so I don't know how to proceed. Google searching seems to imply that this is about hibernating vs going into some special mode. Arch wiki also says:

"If you run system firmware version 0.1.17 do not set the suspend mode in UEFI setup to Linux (S3). This sleep mode is not supported by the CPU. If you set S3 mode and upgrade the system firmware you need to do a downgrade to 0.1.17 to change it back, because the option is removed in newer firmware. If you set S3 mode nevertheless and try to suspend to mem/S3 mode the system will crash and you need to reset it by holding the power button for a few seconds."

I have not yet explored this in the pre-OS UEFI settings but will try that after filing this bug.

ProblemType: Bug
DistroRelease: Ubuntu 23.10
Package: linux-image-6.5.0-9-generic 6.5.0-9.9
ProcVersionSignature: Ubuntu 6.5.0-9.9-generic 6.5.3
Uname: Linux 6.5.0-9-generic x86_64
ApportVersion: 2.27.0-0ubuntu5
Architecture: amd64
CRDA: N/A
CasperMD5CheckResult: unknown
CloudArchitecture: x86_64
CloudID: none
CloudName: none
CloudPlatform: none
CloudSubPlatform: config
CurrentDesktop: ubuntu:GNOME
Date: Wed Oct 18 15:08:29 2023
InstallationDate: Installed on 2023-10-18 (1 days ago)
InstallationMedia: Ubuntu 23.10.1 "Mantic Minotaur" - Release amd64 (20231016.1)
MachineType: {report['dmi.sys.vendor']} {report['dmi.product.name']}
ProcEnviron:
 LANG=en_US.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
 XDG_RUNTIME_DIR=<set>
ProcFB: 0 amdgpudrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-6.5.0-9-generic root=UUID=ecb1730b-cbe1-457c-a4f8-23e2eaf89020 ro quiet splash vt.handoff=7
RelatedPackageVersions:
 linux-restricted-modules-6.5.0-9-generic N/A
 linux-backports-modules-6.5.0-9-generic N/A
 linux-firmware 20230919.git3672ccab-0ubuntu2.1
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 08/08/2023
dmi.bios.release: 1.40
dmi.bios.vendor: LENOVO
dmi.bios.version: R23ET70W (1.40 )
dmi.board.asset.tag: Not Available
dmi.board.name: 21CF000CUS
dmi.board.vendor: LENOVO
dmi.board.version: SDK0T76538 WIN
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: None
dmi.ec.firmware.release: 1.30
dmi.modalias: dmi:bvnLENOVO:bvrR23ET70W(1.40):bd08/08/2023:br1.40:efr1.30:svnLENOVO:pn21CF000CUS:pvrThinkPadT14Gen3:rvnLENOVO:rn21CF000CUS:rvrSDK0T76538WIN:cvnLENOVO:ct10:cvrNone:skuLENOVO_MT_21CF_BU_Think_FM_ThinkPadT14Gen3:
dmi.product.family: ThinkPad T14 Gen 3
dmi.product.name: 21CF000CUS
dmi.product.sku: LENOVO_MT_21CF_BU_Think_FM_ThinkPad T14 Gen 3
dmi.product.version: ThinkPad T14 Gen 3
dmi.sys.vendor: LENOVO

Revision history for this message
Andi McClure (andi-mcc) wrote :
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Status changed to Confirmed

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Andi McClure (andi-mcc) wrote :

A person on Mastodon https://mastodon.social/@<email address hidden>/111257661723565538 says that they have working close laptop suspend/wake on Fedora 38 and the Thinkpad T14S, amd, gen 3, which is a very weak indication that this is a problem not with Linux in general but with either Ubuntu 23.10 or my current system configuration.

Revision history for this message
Andi McClure (andi-mcc) wrote :

I booted into the UEFI settings (Lenovo calls these "BIOS settings") and saw nothing about suspend methods so now I don't understand what the "If you run system firmware version 0.1.17 do not set the suspend mode in UEFI setup to Linux (S3)." in the Arch wiki means. The power options in the BIOS setup are are "Intelligent cooling boost" "CPU Power Management" and "Power on with AC attach". So I do not know how to proceed on that front, now (I understand there are several different suspend methods available, but I do not know how to find out on Ubuntu which one is selected and if I knew which one was selected I don't know how to change it)

Revision history for this message
Andi McClure (andi-mcc) wrote :

Okay, I got a long journalctl snap from immediately before closing the lid to immediately after opening it.

It is attached to this comment.

Things I notice:
- Zillions of comments reading "systemd-logind: hibernation is restricted; see man kernel_lockdown.7". Not sure if that's meaningful.
- A number of lines reading "Error reading events from display: Broken pipe" from various processes that were running.
- Lots of processes being stopped. That shouldn't happen in a hibernate as far as I know. (???)

Revision history for this message
Andi McClure (andi-mcc) wrote :

Two additional tests I did:

- I installed systemd-coredump and repeated the journald test. I did NOT see any message that a process had dumped core during the sleep/wake cycle.

- Not exactly an intentional test but I discovered I don't have to hibernate / close-lid the laptop to get the bad behavior. If I leave the screen open and just wait for five to ten minutes, it bumps to a "log in" screen. When I log in all my apps are gone. At no point did the screen turn off.

Revision history for this message
Andi McClure (andi-mcc) wrote :

Additional data point: When the lose-all-apps event occurs (close lid/open lid cycle) all GNOME extensions are disabled. If I go into the "extensions" app the big "all extensions" switch is off. https://files.mastodon.social/media_attachments/files/111/258/167/197/437/420/original/b237b48d5d2fee63.png If I re-enable extensions, I can log out or reboot and when I come back my extensions are still on, but if I do a lid cycle extensions get switched off.

Revision history for this message
Andi McClure (andi-mcc) wrote :

Just found this line in both of my journalctl logs (the one in comment 5 and the one I didn't bother uploading)

Oct 18 16:20:11 Anthy systemd[1886]: <email address hidden>: Main process exited, code=killed, status=9/KILL

Seems kinda bad!!! Why would someone be sending wayland.service a kill -9

Revision history for this message
Andi McClure (andi-mcc) wrote :

Running "suspend" from the activity menu also causes the bad event (same as lid close/open)

Revision history for this message
Andi McClure (andi-mcc) wrote :

Someone on Mastodon found this bug-- could this be related / the root cause? Configuration and symptoms are VERY similar https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/2034619

Revision history for this message
Emelia Cadence (becomethewaifu) wrote :

For context, 'that person on Mastodon' is me, and given that there's already 5 other duplicates for bug #2034619 I strongly suspect this one is as well. Another interesting coincidence with that bug is that Andi's laptop is a similar model to the one in the other bug: a "T14s gen 3 AMD", while the other is "P14s gen 3 AMD". Knowing how Lenovo does laptop series, I'd suspect they're near identical on the inside other than the P-series using a higher-end processor.

Revision history for this message
Chris Halse Rogers (raof) wrote :

An interesting test might be to run “echo mem | sudo tee /sys/power/state” from a terminal; this will *just* get the kernel to suspend, without executing any other suspend hooks (like locking the screen, etc).

I concur with “that person on Mastodon” (☺), though; it looks a lot like that mutter bug.

Revision history for this message
Mario Limonciello (superm1) wrote :

I was just checking a Lenovo X13 for another issue and reproduced the same thing. This is a duplicate of that other bug.

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.