GNOME session is shut down during OOM and returns back to login screen

Bug #2077254 reported by Rudolf
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
New
Undecided
Unassigned

Bug Description

When too many applications are running and RAM gets full, the OS evicts the most RAM intensive application and kills it. Since anything runs below GNOME in the process hierarchy, GNOME is selected and killed. When it restarts I am back at the login screen.
This is very annoying since all my work is gone. I guess it is a bug since the RAM intensive application itself should be killed and now my whole desktop environment.

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: xorg 1:7.7+23ubuntu2
ProcVersionSignature: Ubuntu 6.5.0-45.45~22.04.1-generic 6.5.13
Uname: Linux 6.5.0-45-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
.proc.driver.nvidia.capabilities.gpu0: Error: path was not a regular file.
.proc.driver.nvidia.capabilities.mig: Error: path was not a regular file.
.proc.driver.nvidia.gpus.0000.01.00.0: Error: path was not a regular file.
.proc.driver.nvidia.registry: Binary: ""
.proc.driver.nvidia.suspend: suspend hibernate resume
.proc.driver.nvidia.suspend_depth: default modeset uvm
.proc.driver.nvidia.version:
 NVRM version: NVIDIA UNIX x86_64 Kernel Module 535.183.01 Sun May 12 19:39:15 UTC 2024
 GCC version: gcc version 12.3.0 (Ubuntu 12.3.0-1ubuntu1~22.04)
ApportVersion: 2.20.11-0ubuntu82.6
Architecture: amd64
BootLog: Error: [Errno 13] Keine Berechtigung: '/var/log/boot.log'
CasperMD5CheckResult: pass
CompositorRunning: None
CurrentDesktop: ubuntu:GNOME
Date: Sun Aug 18 10:09:14 2024
DistUpgraded: Fresh install
DistroCodename: jammy
DistroVariant: ubuntu
DkmsStatus:
 virtualbox/6.1.50, 6.5.0-45-generic, x86_64: installed
 virtualbox/6.1.50, 6.8.0-40-generic, x86_64: installed
GraphicsCard:
 Intel Corporation TigerLake-LP GT2 [Iris Xe Graphics] [8086:9a49] (rev 01) (prog-if 00 [VGA controller])
   Subsystem: Lenovo TigerLake-LP GT2 [Iris Xe Graphics] [17aa:3f87]
   Subsystem: Lenovo TU117M [GeForce MX450] [17aa:3f87]
InstallationDate: Installed on 2022-08-17 (731 days ago)
InstallationMedia: Ubuntu 22.04.1 LTS "Jammy Jellyfish" - Release amd64 (20220809.1)
MachineType: LENOVO 82FE
ProcEnviron:
 LANGUAGE=de_AT:de
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=de_AT.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-6.5.0-45-generic root=UUID=2696b433-58c2-4a79-80b7-5b6f83c087a6 ro quiet splash vt.handoff=7
RebootRequiredPkgs: Error: path contained symlinks.
SourcePackage: xorg
Symptom: display
Title: Xorg crash
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 02/02/2021
dmi.bios.release: 1.24
dmi.bios.vendor: LENOVO
dmi.bios.version: FKCN24WW(V1.08)
dmi.board.asset.tag: NO Asset Tag
dmi.board.name: LNVNB161216
dmi.board.vendor: LENOVO
dmi.board.version: SDK0J40700 WIN
dmi.chassis.asset.tag: NO Asset Tag
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: IdeaPad 5 14ITL05
dmi.ec.firmware.release: 1.24
dmi.modalias: dmi:bvnLENOVO:bvrFKCN24WW(V1.08):bd02/02/2021:br1.24:efr1.24:svnLENOVO:pn82FE:pvrIdeaPad514ITL05:rvnLENOVO:rnLNVNB161216:rvrSDK0J40700WIN:cvnLENOVO:ct10:cvrIdeaPad514ITL05:skuLENOVO_MT_82FE_BU_idea_FM_IdeaPad514ITL05:
dmi.product.family: IdeaPad 5 14ITL05
dmi.product.name: 82FE
dmi.product.sku: LENOVO_MT_82FE_BU_idea_FM_IdeaPad 5 14ITL05
dmi.product.version: IdeaPad 5 14ITL05
dmi.sys.vendor: LENOVO
version.compiz: compiz N/A
version.libdrm2: libdrm2 2.4.113-2~ubuntu0.22.04.1
version.libgl1-mesa-dri: libgl1-mesa-dri 23.2.1-1ubuntu3.1~22.04.2
version.libgl1-mesa-glx: libgl1-mesa-glx 23.0.4-0ubuntu1~22.04.1
version.nvidia-graphics-drivers: nvidia-graphics-drivers-* N/A
version.xserver-xorg-core: xserver-xorg-core 2:21.1.4-2ubuntu1.7~22.04.11
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev N/A
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:19.1.0-2ubuntu1
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.99.917+git20210115-1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.17-2build1

Revision history for this message
Rudolf (rudolf97) wrote :
affects: ubuntu → xorg (Ubuntu)
Revision history for this message
Daniel van Vugt (vanvugt) wrote (last edit ):

For most people, having too many browser tabs or virtual machines open will be the trigger for this. But we should also discuss the correctness of killing the shell via systemd-oomd.

affects: xorg (Ubuntu) → systemd (Ubuntu)
summary: - GUI crashes and returns back to login screen
+ GUI is killed and returns back to login screen
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: GUI is killed and returns back to login screen

Just in case killing the shell is *correct*, please ensure you don't have any local extensions installed:

  cd ~/.local/share/gnome-shell
  rm -rf extensions

and then log in again. Because extensions are the main cause of shell memory leaks, and it looks like there is one:

  [522352.701692] [ 1850] 1000 1850 1805745 38171 2904064 14008 0 gnome-shell

affects: systemd (Ubuntu) → gnome-shell (Ubuntu)
Changed in gnome-shell (Ubuntu):
status: New → Incomplete
tags: added: gnome-shell-leak
Revision history for this message
Rudolf (rudolf97) wrote :

There is no extensions folder in the specified directory, so I don't think there aren't any installed.
As I said the thing happens when too many things are open (many tabs and a VM running).
I am just arguing that killing the whole GUI environment seems wrong to me..

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

I think I might have misinterpreted that table. gnome-shell was only using 156348416 bytes (156MB) of RAM. Other processes like 'java', 'kdevelop', 'VirtualBoxVM' and lots of Firefox tabs seem to be the reason the machine ran out of memory.

So overall it sounds like gnome-shell probably just crashed, not being able to cope with memory allocation failure somewhere. As such, we should treat this as a regular crash so please follow these steps:

1. Run these commands:
    journalctl -b0 > journal.txt
    journalctl -b-1 > prevjournal.txt
and attach the resulting text files here.

2. Look in /var/crash for crash files and if found run:
    ubuntu-bug YOURFILE.crash
Then tell us the ID of the newly-created bug.

3. If step 2 failed then look at https://errors.ubuntu.com/user/ID where ID is the content of file /var/lib/whoopsie/whoopsie-id on the machine. Do you find any links to recent problems on that page? If so then please send the links to us.

Please take care to avoid attaching .crash files to bugs as we are unable to process them as file attachments. It would also be a security risk for yourself.

Revision history for this message
Rudolf (rudolf97) wrote :
Revision history for this message
Rudolf (rudolf97) wrote :
Revision history for this message
Rudolf (rudolf97) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote (last edit ):

Thanks. Those crash reports are from 1-2 years ago so don't look relevant.

journal.txt seems to show the problem. The system ran out of memory at Aug 18 10:08:14 but gnome-shell kept running. It was then told to shut down cleanly by systemd and you can see the clean shutdown a few seconds later at Aug 18 10:08:20.

So I think this is a systemd feature. It notices something was killed due to low memory, other processes then struggle to respond to queries due to low memory, and then the entire session gets shut down cleanly. There is no crash here, and no gnome-shell bug that I can see.

affects: gnome-shell (Ubuntu) → systemd (Ubuntu)
summary: - GUI is killed and returns back to login screen
+ GNOME session is shut down during OOM and returns back to login screen
Changed in systemd (Ubuntu):
status: Incomplete → New
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.