Public bug reported:

On Ubuntu 24.04 LTS running a GNOME X11 session, GNOME Shell
occasionally aborts and the entire graphical session is terminated when
my only display, an HDMI-connected TV on an NVIDIA GPU, is powered off.

The problem is intermittent and is not reliably reproducible. Powering
off the display normally works without problems. On this occurrence I
was able to preserve the Apport core dump and analyze it with the exact
matching Mutter debug symbols.

The crash appears to be a race/state-consistency problem in Mutter while
there is temporarily no logical monitor.

Environment:

Ubuntu 24.04 LTS
GNOME session: X11
gnome-shell: 46.0-0ubuntu6~24.04.15
libmutter-14-0: 46.2-1ubuntu0.24.04.16
Matching libmutter-14-0-dbgsym 46.2-1ubuntu0.24.04.16 used for the analysis
NVIDIA proprietary driver libraries in the core: 595.91.07
Single physical display connected via HDMI
Tiling Assistant is not installed

Several other GNOME Shell extensions are enabled, but the fully
symbolized crashing call path is entirely inside Mutter's native X11
event handling.

Observed sequence:

The display was powered off using its remote control.

The NVIDIA/X11 log subsequently reported that the only display had
disappeared:

NVIDIA(GPU-0): LG Electronics LG TV SSCR2 (DFP-0): disconnected
NVIDIA(0): Setting mode "NULL"

Immediately afterwards GNOME Shell aborted:

libmutter:ERROR:../src/core/window.c:5957:
meta_window_get_work_area_for_logical_monitor:
assertion failed: (logical_monitor)

GNOME Shell crashed with signal 6

The shell restart did not preserve the session and the system eventually
returned to the GDM login screen. The machine itself did not reboot.

Fully symbolized crash path:

#13 meta_window_get_work_area_for_logical_monitor
    at ../src/core/window.c:5957

#14 meta_window_get_work_area_current_monitor
    at ../src/core/window.c:5992

#15 meta_window_unmaximize
    at ../src/core/window.c:3243

#17 meta_window_x11_client_message
    at ../src/x11/window-x11.c:3232

#18 handle_other_xevent
    at ../src/x11/events.c:1638

#19 meta_x11_display_handle_xevent
    at ../src/x11/events.c:1930

#20 xevent_func
    at ../src/x11/events.c:1969

#21 meta_x11_event_source_dispatch
    at ../src/x11/meta-x11-event-source.c:62

The affected MetaWindow was a maximized X11 window from Master PDF
Editor 5.

Relevant state from the core:

window = 0x619e7f90e830

window->res_class = "Master PDF Editor 5"
window->res_name = "masterpdfeditor5"

window->monitor = 0x0

window->maximized_horizontally = 1
window->maximized_vertically = 1
window->fullscreen = 0

window->rect = {x = 0, y = 64, width = 3840, height = 2024}
window->saved_rect = {x = 50, y = 77, width = 657, height = 516}

Thus, when meta_window_unmaximize() was called, the window was still
marked as maximized but its MetaWindow.monitor was already NULL.

The X11 ClientMessage preserved in the core was:

type = 33 (ClientMessage)
send_event = 1
window = 0x6a00006
format = 32
message_type = 324

data.l[0] = 0
data.l[1] = 331
data.l[2] = 330
data.l[3] = 0
data.l[4] = 0

The Mutter atom values from the same core are:

atom__NET_WM_STATE = 324
atom__NET_WM_STATE_MAXIMIZED_HORZ = 331
atom__NET_WM_STATE_MAXIMIZED_VERT = 330

Therefore the event was exactly:

_NET_WM_STATE
action = _NET_WM_STATE_REMOVE

states:
_NET_WM_STATE_MAXIMIZED_HORZ
_NET_WM_STATE_MAXIMIZED_VERT

for the same X11 window 0x6a00006.

The resulting sequence appears to be:

last physical display disappears
-> window->monitor becomes NULL
-> _NET_WM_STATE_REMOVE arrives for MAXIMIZED_HORZ and MAXIMIZED_VERT
-> meta_window_x11_client_message()
-> meta_window_unmaximize()
-> meta_window_get_work_area_current_monitor()
-> meta_window_get_work_area_for_logical_monitor(window, window->monitor, area)
-> window->monitor is NULL
-> assertion failure
-> SIGABRT

I cannot determine from the X event alone which X11 client originally
sent the ClientMessage, so I am not claiming that Master PDF Editor
itself caused the problem. It is the target window of the message.

Regardless of the sender, Mutter should handle the transient
window->monitor == NULL state without aborting the entire GNOME Shell
process.

Expected result:

Disconnecting or powering off the last display, including while X11
window-state requests occur, must not terminate GNOME Shell or the
graphical user session.

When the display reconnects, the existing session should still be
usable.

Actual result:

Mutter passes a NULL logical monitor into
meta_window_get_work_area_for_logical_monitor(). The assertion aborts
GNOME Shell with SIGABRT and the graphical session is eventually
terminated.

Reproducibility:

Low/intermittent.

I have experienced this only a few times. Simply powering the display
off is normally safe. Based on the core dump, the crash appears to
require the additional _NET_WM_STATE unmaximize request to arrive during
the short interval in which the window no longer has an associated
logical monitor.

This timing dependency would explain why the problem is difficult to
reproduce intentionally.

Related bug:

Launchpad bug #2097003 appears closely related and has the same
meta_window_get_work_area_for_logical_monitor assertion failure.

My case provides a fully symbolized native X11 path:

meta_window_x11_client_message()
-> meta_window_unmaximize()
-> meta_window_get_work_area_current_monitor()

with window->monitor == NULL and the triggering _NET_WM_STATE
ClientMessage preserved in the core.

I have retained the original Apport crash data, core dump and matching
debug symbols locally and can provide additional GDB output if required.

ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: libmutter-14-0 46.2-1ubuntu0.24.04.16
ProcVersionSignature: Ubuntu 6.8.0-142.142-generic 6.8.12
Uname: Linux 6.8.0-142-generic x86_64
ApportVersion: 2.28.3-0ubuntu0.1
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Wed Oct  7 21:11:09 2026
InstallationDate: Installed on 2023-10-15 (1088 days ago)
InstallationMedia: Ubuntu 22.04.3 LTS "Jammy Jellyfish" - Release amd64 
(20230807.2)
SourcePackage: mutter
UpgradeStatus: No upgrade log present (probably fresh install)

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


** Tags: amd64 apport-bug noble

** Attachment added: "Sanitized GDB core-dump analysis and relevant journal 
excerpt"
   
https://bugs.launchpad.net/bugs/2169888/+attachment/6006916/+files/mutter-crash-diagnostics.txt

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2169888

Title:
  GNOME Shell X11 crashes when last HDMI display disconnects during
  window unmaximize

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


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

Reply via email to