GNOME Bugzilla – Bug 788607
Crashes while turning monitor off and back on while logged in
Last modified: 2017-10-12 18:52:04 UTC
gnome-shell will crash twice when the monitor is turned off and back on again. Just started today after upgrading from 3.24 to 3.26. 1. Sign into Gnome Wayland 2. Turn monitor off 3. Turn monitor on 4. gnome-shell crash twice 4K Monitor connection is DisplayPort. I would attach a copy of the core dump but the compressed size only gets down to 11MB for each. 1st Core Dump Info: Fri 2017-10-06 10:02:18 CDT Stack trace of thread 30966: #0 0x00007f05deeeb8a0 raise (libc.so.6) #1 0x00007f05deeecf09 abort (libc.so.6) #2 0x00007f05de1adc06 g_assertion_message (libglib-2.0.so.0) #3 0x00007f05de1adfcc g_assertion_message_expr (libglib-2.0.so.0) #4 0x00007f05dc673610 meta_monitor_manager_get_logical_monitor_from_number (libmutter-1.so.0) #5 0x00007f05dc6c33b9 meta_workspace_get_work_area_for_monitor (libmutter-1.so.0) #6 0x00007f05d8b301c8 ffi_call_unix64 (libffi.so.6) #7 0x00007f05d8b2fc2a ffi_call (libffi.so.6) #8 0x00007f05dd14ecbb n/a (libgjs.so.0) #9 0x00007f05dd150617 n/a (libgjs.so.0) #10 0x00007f05d67fb80d n/a (libmozjs-52.so.0) #11 0x00007f05d67fb939 n/a (libmozjs-52.so.0) #12 0x00007f05d65eb3d9 n/a (libmozjs-52.so.0) #13 0x00000eb4b502a3c6 n/a (n/a) 2nd Core Dump Info: Fri 2017-10-06 10:02:20 CDT Stack trace of thread 3342: #0 0x00007f103da8f7e0 meta_window_update_for_monitors_changed (libmutter-1.so.0) #1 0x00007f103f575c4d g_slist_foreach (libglib-2.0.so.0) #2 0x00007f103da7e466 meta_screen_foreach_window (libmutter-1.so.0) #3 0x00007f103da810a9 n/a (libmutter-1.so.0) #4 0x00007f1039f001c8 ffi_call_unix64 (libffi.so.6) #5 0x00007f1039effc2a ffi_call (libffi.so.6) #6 0x00007f103f86184b g_cclosure_marshal_generic (libgobject-2.0.so.0) #7 0x00007f103f8586f5 g_closure_invoke (libgobject-2.0.so.0) #8 0x00007f103f86c0b0 n/a (libgobject-2.0.so.0) #9 0x00007f103f870696 g_signal_emit_valist (libgobject-2.0.so.0) #10 0x00007f103f87162c g_signal_emit_by_name (libgobject-2.0.so.0) #11 0x00007f103da451c8 meta_monitor_manager_rebuild_derived (libmutter-1.so.0) #12 0x00007f103da51af2 n/a (libmutter-1.so.0) #13 0x00007f103da429cc n/a (libmutter-1.so.0) #14 0x00007f103da43893 meta_monitor_manager_ensure_configured (libmutter-1.so.0) #15 0x00007f103da52389 meta_monitor_manager_xrandr_handle_xevent (libmutter-1.so.0) #16 0x00007f103da4af57 n/a (libmutter-1.so.0) #17 0x00007f103f588270 g_main_context_dispatch (libglib-2.0.so.0) #18 0x00007f103f589f69 n/a (libglib-2.0.so.0) #19 0x00007f103f58af42 g_main_loop_run (libglib-2.0.so.0) #20 0x00007f103da797f0 meta_run (libmutter-1.so.0) #21 0x000055b79535be8c n/a (gnome-shell) #22 0x00007f10402a7f6a __libc_start_main (libc.so.6) #23 0x000055b79535bfba n/a (gnome-shell)
Created attachment 361072 [details] [review] layout: Unset primary and bottom monitor when headless We were handling being initially headless by only setting the primary and bottom monitor if there was any primary monitor, then checking the primary monitor reference before making calls assuming there was any monitors. What we didn't do was unset the primary and bottom monitor when going headless, meaning that temporarly disconnecting a monitor while having windows open caused an assert to be triggered due to various code paths taking the path assuming there are valid monitors. Unsetting both the primary and bottom monitor when going headless avoids the code paths in the same way as they were avoided when starting headless.
Review of attachment 361072 [details] [review]: LGTM
Created attachment 361083 [details] [review] window: Handle updating from no to no monitor When we received two hot plug events that both resulted in headless configuration, we tried to find a new window monitor given the old. That resulted in a null pointer dereference; avoid that by only trying to find the same monitor if there was an old one.
Created attachment 361084 [details] [review] monitor-unit-tests: Check going headless -> headless
Comment on attachment 361072 [details] [review] layout: Unset primary and bottom monitor when headless Attachment 361072 [details] pushed as db43c45 - layout: Unset primary and bottom monitor when headless
Backported 'layout: Unset primary and bottom monitor when headless' to gnome-3-26
Review of attachment 361083 [details] [review]: OK
Review of attachment 361084 [details] [review]: ++
Attachment 361083 [details] pushed as 6eb7d13 - window: Handle updating from no to no monitor Attachment 361084 [details] pushed as 76096a7 - monitor-unit-tests: Check going headless -> headless
Backported mutter part to gnome-3-26.
(In reply to Jonas Ådahl from comment #5) > Attachment 361072 [details] pushed as db43c45 - layout: Unset primary and > bottom monitor when headless I can't seem to find this commit anywhere (to cherry pick to try fixing this issue locally, see also #788764)
(In reply to Georg Wicherski from comment #11) > (In reply to Jonas Ådahl from comment #5) > > Attachment 361072 [details] pushed as db43c45 - layout: Unset primary and > > bottom monitor when headless > > I can't seem to find this commit anywhere It's a gnome-shell patch.