After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 756660 - monitor-manager-xrandr: Be more robust when reading XRROutputInfos
monitor-manager-xrandr: Be more robust when reading XRROutputInfos
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2015-10-15 17:57 UTC by Rui Matos
Modified: 2015-10-16 12:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
monitor-manager-xrandr: Be more robust when reading XRROutputInfos (3.05 KB, patch)
2015-10-15 17:57 UTC, Rui Matos
committed Details | Review

Description Rui Matos 2015-10-15 17:57:53 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.
Comment 1 Rui Matos 2015-10-15 17:57:57 UTC
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.
Comment 2 Jasper St. Pierre (not reading bugmail) 2015-10-15 18:30:46 UTC
Review of attachment 313391 [details] [review]:

Bizarre. Looks good to me.
Comment 3 Rui Matos 2015-10-16 12:11:12 UTC
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