Public bug reported:
1) Ubuntu release
Ubuntu 24.04.5 LTS, "Ubuntu on Xorg" session
2) Package versions
mutter / libmutter-14-0 46.2-1ubuntu0.24.04.18
gnome-shell 46.0-0ubuntu6~24.04.17
gnome-control-center 1:46.7-0ubuntu0.24.04.6
xorg-server 2:21.1.12-1ubuntu1.9
nvidia-driver-595-open 595.99.02-0ubuntu0.24.04.1
linux 7.0.0-43-generic
3) What I expected to happen
Plugging in a second external display that my saved monitor layout keeps
disabled, and then opening Settings > Displays, shows the Displays panel.
4) What happened instead
gnome-shell crashes with SIGSEGV as soon as the Displays panel opens. The shell
restarts, the still-open panel triggers the same crash again, and GNOME then
ends the session (logout to GDM). It happens every time.
== Setup ==
Hybrid laptop. The NVIDIA GPU drives the X screen and the built-in panel
(DP-0). The Intel iGPU is a RandR output provider (modesetting) and
drives the USB-C/Thunderbolt DisplayPort output DP-1-1.
- A 4K monitor on DP-1-1 (Intel) is the only enabled monitor. That layout was
saved from Settings > Displays, so ~/.config/monitors.xml has an entry with
DP-1-1 enabled and the other outputs under <disabled>, and no <maxbpc> element.
- A second 1920x1080 display is plugged into an NVIDIA output (DP-1).
monitors.xml already has a matching configuration that keeps it disabled.
The Intel output has a RandR "max bpc" property (value 12, range 6-12).
The NVIDIA outputs have no such property.
== Steps to reproduce ==
1. Log in to the Xorg session with only the monitor on the Intel output
enabled, using a layout saved from Settings.
2. Plug in a second display for which monitors.xml has a configuration that
leaves it disabled, so the resulting X configuration is identical to the
current one.
3. Open Settings > Displays.
keeps it disabled.
The Intel output has a RandR "max bpc" property (value 12, range 6-12).
The NVIDIA outputs have no such property.
== Steps to reproduce ==
1. Log in to the Xorg session with only the monitor on the Intel output
enabled, using a layout saved from Settings.
2. Plug in a second display for which monitors.xml has a configuration that
leaves it disabled, so the resulting X configuration is identical to the
current one.
3. Open Settings > Displays.
== Crash ==
Thread 1 (gnome-shell), SIGSEGV:
#6 meta_monitor_manager_get_monitor_for_connector (manager=<optimized out>,
connector="DP-1-1") at ../src/backends/meta-monitor-manager.c:4284
#7-#9 ffi_call (libffi)
#10- libgjs / libmozjs-115
JS stack:
#0 resource:///org/gnome/shell/ui/osdMonitorLabeler.js:104
#1 resource:///org/gnome/shell/ui/shellDBus.js:354 (ShowMonitorLabels)
The faulting instruction is the "->number" dereference of the NULL
return value of meta_monitor_get_logical_monitor():
if (meta_monitor_is_active (monitor) &&
g_str_equal (connector, meta_monitor_get_connector (monitor)))
return meta_monitor_get_logical_monitor (monitor)->number;
State read from the core dump with debug symbols:
- manager->monitors holds three MetaMonitor objects: DP-0 (no current mode),
DP-1 (no current mode), DP-1-1 (current mode [email protected],
priv->logical_monitor == NULL).
- manager->logical_monitors holds one logical monitor whose monitors list
points to a different, older MetaMonitor object for DP-1-1.
- The MetaOutput of the new DP-1-1 monitor has has_max_bpc == FALSE but max_bpc
== 12.
So the monitors were rebuilt by
meta_monitor_manager_read_current_state(), a configuration was then
applied to the outputs, and the logical monitors were never rebuilt
afterwards.
== Analysis (AI assisted) ==
1. meta_monitor_manager_xrandr_handle_xevent() receives the hotplug
RRScreenChangeNotify, calls meta_monitor_manager_read_current_state() (new
MetaMonitor/MetaOutput objects; the output gets has_max_bpc = TRUE, max_bpc =
12 from the "max bpc" property) and then meta_monitor_manager_reconfigure().
2. The stored configuration is applied through
meta_monitor_manager_xrandr_apply_monitors_config(). It only updates the
logical state directly (meta_monitor_manager_rebuild_derived()) when
is_assignments_changed() returns FALSE; otherwise it calls
apply_crtc_assignments() and relies on the resulting RRScreenChangeNotify to
rebuild.
3. is_output_assignment_changed()
(src/backends/x11/meta-monitor-manager-xrandr.c) returns TRUE whenever the
output has a max bpc and the assignment has none:
if (meta_output_get_max_bpc (output, &max_bpc))
{
if (!output_assignment->has_max_bpc ||
max_bpc != output_assignment->max_bpc)
return TRUE;
}
Configurations applied through the org.gnome.Mutter.DisplayConfig D-Bus API
(GNOME Settings) never carry a max bpc, so for any output with a "max bpc"
property this check always reports a change.
4. apply_crtc_assignments() re-applies the identical CRTC configuration.
meta_output_assign_crtc() resets has_max_bpc to FALSE (matching the core dump),
and meta_output_xrandr_apply_mode() does not touch the property. Nothing
changes on the X server, so it sends no RRScreenChangeNotify.
5. handle_xevent() therefore never runs again, the logical monitors still
reference the old MetaMonitor objects, and the next caller of
meta_monitor_manager_get_monitor_for_connector() dereferences NULL. GNOME
Settings triggers that through ShowMonitorLabels when the Displays panel opens.
The same code is present in the upstream gnome-46 and gnome-48 branches.
The NVIDIA GPU should not be required: any Xorg session with an output
that has a "max bpc" property (modesetting DDX on Intel/AMD) and a
hotplug that leaves the X configuration unchanged should hit this, but I
have only reproduced it on the hybrid setup above.
** Affects: mutter (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2175719
Title:
gnome-shell crashes with SIGSEGV in
meta_monitor_manager_get_monitor_for_connector() when opening Settings
> Displays after a monitor hotplug (Xorg session)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/2175719/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs