Public bug reported:

Ubuntu release:
Ubuntu 26.04 LTS (Resolute)

Affected package:
gdm3

Installed versions:
gdm3:        50.1-0ubuntu0.1
gnome-shell: 50.1-0ubuntu1.2

Kernel:
7.0.0-30-generic

Session type:
Wayland

Graphics hardware:
Intel RocketLake-S GT1 [UHD Graphics 750]
NVIDIA GeForce RTX 3060 12 GB
NVIDIA GeForce RTX 3060 8 GB

NVIDIA driver:
595.84 (NVIDIA Open Kernel Module)


SUMMARY
=======

The long-running gdm-session-worker associated with my GNOME login session
appears to leak private D-Bus UNIX socket file descriptors.

The leaked descriptors point to unique sockets under:

    /run/gdm3/dbus/dbus-XXXXXXXX

The descriptor count grows over time and also reproducibly increases during
GNOME lock/unlock.

Eventually, with the default soft NOFILE limit of 1024, gdm-session-worker
starts failing with:

    Gdm: Could not start command '/usr/libexec/gdm-session-worker':
    Too many open files

followed by:

    Gdm: Cannot create worker D-Bus server for the session:
    Unable to create socket: Too many open files

and:

    Gdm: Cannot create greeter D-Bus server for the session:
    Unable to create socket: Too many open files

This correlates with screen blinking/flickering, input becoming unreliable,
mouse lag, GNOME authentication/reauthentication errors, and eventually the
graphical session becoming unusable or returning to the login screen.


EXPECTED BEHAVIOR
=================

Locking and unlocking a GNOME Wayland session should not cause
gdm-session-worker to permanently accumulate private D-Bus socket file
descriptors.

The descriptor count should return to approximately its previous baseline
after reauthentication completes.

The graphical session should remain stable indefinitely.


ACTUAL BEHAVIOR
===============

Immediately after reboot/login, the relevant gdm-session-worker had:

    PID=7266
    FDs=11

The process limits were:

    Max open files    65536    524288    files

The 65536 soft limit is a local diagnostic/mitigation change. Before this
change, the process had:

    Max open files    1024     524288    files

After one initial lock/unlock test, the descriptor count increased:

    11 -> 14

After several hours of use, around the time screen blinking was observed,
the same worker had:

    PID=7266
    FDs=296

lsof showed approximately:

    290 unix
    47 REG
    4 a_inode
    2 DIR
    1 netlink
    1 CHR

Further inspection showed that almost all of the additional open descriptors
were connected UNIX sockets under:

    /run/gdm3/dbus/

For example:

    /run/gdm3/dbus/dbus-CxUTnoFS
    /run/gdm3/dbus/dbus-ioKEXaw7
    /run/gdm3/dbus/dbus-jUtn8TwX
    /run/gdm3/dbus/dbus-6ipS2yxJ
    /run/gdm3/dbus/dbus-FKb2N2ww
    /run/gdm3/dbus/dbus-bMYmdY9j

All were shown as:

    type=STREAM (CONNECTED)


REPRODUCTION
============

1. Boot Ubuntu 26.04 and log into the standard GNOME Wayland session.

2. Identify the persistent gdm-password session worker:

    pid=$(pgrep -n -f 'gdm-session-worker.*gdm-password')

3. Count its private GDM D-Bus sockets:

    sudo lsof -a -p "$pid" -U 2>/dev/null |
        grep '/run/gdm3/dbus/' |
        wc -l

4. Lock the GNOME session:

    loginctl lock-session

5. Unlock normally with the user's password.

6. Repeat the socket count.

In one reproducible test:

    Before lock/unlock: 285
    After lock/unlock:  288

Therefore one lock/unlock cycle left three additional connected private
GDM D-Bus UNIX sockets associated with the same persistent
gdm-session-worker.

Earlier testing similarly showed:

    Initial worker FD count: 11
    After lock/unlock:       14

The descriptors did not return to the original baseline.


HISTORICAL FAILURE WITH DEFAULT NOFILE LIMIT
============================================

Before increasing the soft NOFILE limit for diagnostic purposes,
gdm-session-worker had:

    soft NOFILE = 1024
    hard NOFILE = 524288

On the affected boot, the first "Too many open files" error occurred at:

    Aug 20 07:16:50

Example:

    gdm-password][7511]: Gdm: Could not start command
    '/usr/libexec/gdm-session-worker': Too many open files

This was followed repeatedly by:

    Gdm: Cannot create greeter D-Bus server for the session:
    Unable to create socket: Too many open files

and:

    Gdm: Cannot create worker D-Bus server for the session:
    Unable to create socket: Too many open files

These errors continued until approximately:

    Aug 20 09:19:45

The system/session was subsequently restarted.


GNOME SHELL ERRORS
==================

During the failure, GNOME Shell also generated authentication /
reauthentication errors involving authPrompt and userVerifier, including
failure to open the reauthentication channel.

There were also fingerprint-related authentication code paths observed even
though this machine has no fingerprint reader.

Running:

    fprintd-list "$USER"

returns:

    No devices available

fprintd is normally inactive.


TEMPORARY MITIGATION / DIAGNOSTIC CHANGE
========================================

To prevent the worker from immediately reaching its 1024 descriptor soft
limit while diagnosing the problem, I created:

    /etc/security/limits.d/99-gdm-nofile.conf

containing:

    *    soft    nofile    65536
    *    hard    nofile    524288

/etc/pam.d/gdm-password contains:

    session required pam_limits.so

After reboot, the gdm-session-worker correctly receives:

    Max open files    65536    524288    files

This prevents the process from reaching EMFILE as quickly but DOES NOT fix
the apparent leak.

The worker still accumulated hundreds of private D-Bus sockets.

Therefore increasing NOFILE should be considered only a diagnostic
mitigation, not a resolution.


GPU / KERNEL INVESTIGATION
==========================

Because the original symptom looked like a graphics failure, NVIDIA/kernel
logs were investigated extensively.

The machine contains:

    Intel UHD Graphics 750
    NVIDIA RTX 3060 12 GB
    NVIDIA RTX 3060 8 GB

Both NVIDIA GPUs use the NVIDIA driver.

nvidia-smi reports:

    Driver Version: 595.84
    CUDA Version:   13.2

nvidia_drm modesetting is enabled:

    /sys/module/nvidia_drm/parameters/modeset = Y

Kernel logs from multiple previous boots were searched for:

    NVRM
    Xid
    GPU has fallen off the bus
    NVIDIA errors/faults
    DRM/GPU hangs

No NVIDIA Xid events, GPU resets, "GPU has fallen off the bus" messages,
or other NVIDIA GPU fault events were found across the examined boots.

There were also no relevant GPU/kernel errors immediately preceding the
observed session failure.

Therefore the current evidence points more strongly toward the GDM
authentication/reauthentication D-Bus path than toward an NVIDIA GPU
failure.


OOM INVESTIGATION
=================

The previous boot contained:

    systemd-oomd: No swap; memory pressure usage will be degraded

but no evidence was found that GNOME Shell, GDM, or another relevant process
was killed by the OOM killer.

This does not currently appear to be an OOM-induced session termination.


ADDITIONAL OBSERVATION
======================

A Logitech Unifying Receiver disconnected/reconnected shortly before one
forced restart. However, GDM "Too many open files" errors had already been
occurring for more than two hours before that USB event, so the USB event
does not appear to be the original cause.


CURRENT PACKAGE STATUS
======================

apt policy gdm3:

    Installed: 50.1-0ubuntu0.1
    Candidate: 50.1-0ubuntu0.1

apt policy gnome-shell:

    Installed: 50.1-0ubuntu1.2
    Candidate: 50.1-0ubuntu1.2

No newer gdm3 or gnome-shell package is currently offered by my configured
resolute-updates repository.


CONCLUSION
==========

The evidence suggests that gdm-session-worker is retaining private D-Bus
connections created during GNOME authentication/reauthentication.

The most reproducible indication is that a GNOME lock/unlock cycle increases
the number of connected /run/gdm3/dbus/ UNIX sockets owned by the same
gdm-session-worker:

    285 -> 288

and they do not return to the previous baseline.

Over time the worker accumulated approximately 290 UNIX sockets. On a
previous boot using the default soft NOFILE limit of 1024, the worker
eventually reached descriptor exhaustion and GDM could no longer create
worker/greeter D-Bus sockets.

Please investigate whether GDM's reauthentication path is failing to close
or release private GDBus connections after authentication/reauthentication.

ProblemType: Bug
DistroRelease: Ubuntu 26.04
Package: gdm3 50.1-0ubuntu0.1
ProcVersionSignature: Ubuntu 7.0.0-30.30-generic 7.0.12
Uname: Linux 7.0.0-30-generic x86_64
ApportVersion: 2.34.1-0ubuntu0.1
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Thu Aug 20 19:52:06 2026
InstallationDate: Installed on 2026-07-08 (43 days ago)
InstallationMedia: Ubuntu 26.04 "Resolute Raccoon" - Release amd64 (20260423.1)
ProcEnviron:
 LANG=en_US.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
 XDG_RUNTIME_DIR=<set>
SourcePackage: gdm3
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: gdm3 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug resolute wayland-session

-- 
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/2164698

Title:
  gdm-session-worker leaks private D-Bus UNIX sockets during GNOME
  lock/unlock until reaching NOFILE limit, causing screen blinking and
  session failure

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/2164698/+subscriptions


-- 
desktop-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

Reply via email to