GNOME Bugzilla – Bug 783853
segfault when waking monitors after inactivity
Last modified: 2021-07-05 13:48:27 UTC
My shell seems to crash every time I wake the computer up after my screens have been blanked. I find myself logged out with all programs closed. Looking at /var/log/kern.log, I see segfaults like this every time it happens: [44494.295101] gnome-shell[20338]: segfault at 24 ip 00007f3cd1cb6efd sp 00007fff92e6a958 error 4 in libmutter-0.so.0.0.0[7f3cd1c1c000+131000] [44494.497868] gnome-shell[22804]: segfault at 28 ip 00007fb237b60d74 sp 00007ffd955439b0 error 4 in libmutter-0.so.0.0.0[7fb237b19000+131000] mutter 3.24.2 Ubuntu 17.10 I have 3 displayport monitors connected and running nvidia 381.22. I'll try to get a stacktrace, but I'm not entirely sure how.
Made some progress. Program terminated with signal SIGSEGV, Segmentation fault.
+ Trace 237580
(gdb) p primary $1 = 0x0 Looks like primary is null here: https://git.gnome.org/browse/mutter/tree/src/backends/meta-backend.c?h=gnome-3-24#n128 Not really knowing the codebase, I feel tempted to just add "if (primary == nullptr) return;"
Created attachment 353998 [details] [review] Patch to fix the segfault
This is pretty much what https://bugzilla.gnome.org/review?bug=730551&attachment=349706 does (part of bug 730551)
That's great, I'll just make this as a dupe then :) I did notice there is also another crash in meta_window_move_between_rects (same problem). I couldn't quite determine if any of your patches also dealt with it. Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `/usr/bin/gnome-shell'. Program terminated with signal SIGSEGV, Segmentation fault.
+ Trace 237583
*** This bug has been marked as a duplicate of bug 730551 ***
(In reply to Erik Welander from comment #4) > That's great, I'll just make this as a dupe then :) > > I did notice there is also another crash in meta_window_move_between_rects > (same problem). I couldn't quite determine if any of your patches also dealt > with it. > I think this one is different, and probably not handled. Reopening for that case.
I have the same crash in center_pointer(). I applied your quickfix above and this crash has gone. Now I have another one Stack trace of thread 687: #0 0x00007fe6418b2033 meta_screen_get_monitor_index_for_rect (libmutter-0.so.0) #1 0x00007fe63b37f1c8 ffi_call_unix64 (libffi.so.6) #2 0x00007fe63b37ec2a ffi_call (libffi.so.6) #3 0x00007fe641fdccac n/a (libgjs.so.0) #4 0x00007fe641fde456 n/a (libgjs.so.0) #5 0x00007fe63ac88cd8 n/a (libmozjs-38.so) #6 0x00007fe63ac7e82f n/a (libmozjs-38.so) #7 0x00007fe63ac88932 n/a (libmozjs-38.so) #8 0x00007fe63ac88c24 n/a (libmozjs-38.so) #9 0x00007fe63af91777 n/a (libmozjs-38.so) #10 0x00007fe63ac88cd8 n/a (libmozjs-38.so) #11 0x00007fe63ac89845 n/a (libmozjs-38.so) #12 0x00007fe63addfba4 n/a (libmozjs-38.so) #13 0x00007fe642b56036 n/a (ld-linux-x86-64.so.2) #14 0x0000000001c59090 n/a (n/a) #15 0x00007fe642b507e1 n/a (ld-linux-x86-64.so.2) #16 0x00007fe63ad73d53 n/a (libmozjs-38.so) #17 0x00007fe63ad7b0f3 n/a (libmozjs-38.so) #18 0x00007fe63ac881b0 n/a (libmozjs-38.so) #19 0x00007fe63ac88932 n/a (libmozjs-38.so) #20 0x00007fe63ac88c24 n/a (libmozjs-38.so) #21 0x00007fe63af91777 n/a (libmozjs-38.so) #22 0x00007fe63ac88cd8 n/a (libmozjs-38.so) #23 0x00007fe63ac89845 n/a (libmozjs-38.so) #24 0x00007fe63addfba4 n/a (libmozjs-38.so) #25 0x00007fe642b56036 n/a (ld-linux-x86-64.so.2) #26 0x0000000001c59090 n/a (n/a) #27 0x00007fe642b507e1 n/a (ld-linux-x86-64.so.2) That probably comes from the fact that meta_monitor_manager_get_logical_monitor_from_rect() might return NULL.
I 've seen the same crash and backtrace as comment#4, but on older mutter 3.20 gdb) bt
+ Trace 238399
(gdb) print *workspace $1 = {parent_instance = {g_type_instance = {g_class = 0x2af72b0}, ref_count = 2, qdata = 0x3198211}, screen = 0x29dda60, windows = 0x2cc8f00, mru_list = 0x2ee9c00, list_containing_self = 0x2a6e260, work_area_screen = {x = 0, y = 28, width = 7680, height = 2098}, work_area_monitor = 0x0, screen_region = 0x4e2e420, monitor_region = 0x0, n_monitor_regions = 0, screen_edges = 0x2eea920, monitor_edges = 0x0, builtin_struts = 0x4575270, all_struts = 0x4d2bc00, work_areas_invalid = 0, showing_desktop = 0} (gdb) print workspace->monitor_region $2 = (GList **) 0x0 (gdb) print which_monitor $3 = -723261320 (gdb) print workspace->work_area_monitor $4 = (MetaRectangle *) 0x0 The monitor workspace looks invalid or uninitialized: workspace->monitor_region is NULL. @Jonas, would bug bug#788860 be related, or bug#788834? Or does this look like a different problem? This is quite an old version though.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/mutter/-/issues/ Thank you for your understanding and your help.