GNOME Bugzilla – Bug 756660
monitor-manager-xrandr: Be more robust when reading XRROutputInfos
Last modified: 2015-10-16 12:11:16 UTC
Recently, I started getting crashes like Stack trace of thread 14130: I suppose this a bug introduced recently either in the kernel, the X server or the DDX but we can survive it by being more careful when building our data structures.
Created attachment 313391 [details] [review] monitor-manager-xrandr: Be more robust when reading XRROutputInfos We might get modes in XRROutputInfos that aren't in the XRRScreenResources we get earlier. This always seems to be transient, i.e. when it happens, the X server will usually send us a follow up RRScreenChangeNotify where we then get a "stable" view of the world again. In any case, when these glitches happen, we end up with NULL pointers in the MetaOutput->modes array which makes us crash later on. This patch ensures that doesn't happen.
Review of attachment 313391 [details] [review]: Bizarre. Looks good to me.
git-bz ate the stack trace in comment 0. Let's try again, for the record: 0 0x00007f674bb69628 init_config_from_preferred_mode (libmutter.so.0) 1 0x00007f674bb69978 config_one_untiled_output (libmutter.so.0) 2 0x00007f674bb69ea9 make_linear_config (libmutter.so.0) 3 0x00007f674bb6a43d make_default_config (libmutter.so.0) 4 0x00007f674bb6a722 meta_monitor_config_make_default (libmutter.so.0) 5 0x00007f674bb6f06e meta_monitor_manager_on_hotplug (libmutter.so.0) 6 0x00007f674bb79737 meta_monitor_manager_xrandr_handle_xevent (libmutter.so.0) 7 0x00007f674bb7293b handle_host_xevent (libmutter.so.0) 8 0x00007f674bb72ae6 x_event_source_dispatch (libmutter.so.0) 9 0x00007f6745554e3a g_main_dispatch (libglib-2.0.so.0) 10 0x00007f67455551d0 g_main_context_iterate (libglib-2.0.so.0) 11 0x00007f67455554f2 g_main_loop_run (libglib-2.0.so.0) 12 0x00007f674bba9700 meta_run (libmutter.so.0) 13 0x0000000000402ddf main (gnome-shell) 14 0x00007f6743977580 __libc_start_main (libc.so.6) 15 0x0000000000402309 _start (gnome-shell) Attachment 313391 [details] pushed as 43a1d43 - monitor-manager-xrandr: Be more robust when reading XRROutputInfos