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 783853 - segfault when waking monitors after inactivity
segfault when waking monitors after inactivity
Status: RESOLVED OBSOLETE
Product: mutter
Classification: Core
Component: general
3.24.x
Other Linux
: Normal major
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2017-06-16 06:21 UTC by Erik Welander
Modified: 2021-07-05 13:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix the segfault (1.03 KB, patch)
2017-06-18 18:41 UTC, Erik Welander
none Details | Review

Description Erik Welander 2017-06-16 06:21:13 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.
Comment 1 Erik Welander 2017-06-18 16:23:07 UTC
Made some progress.

Program terminated with signal SIGSEGV, Segmentation fault.
  • #0 center_pointer
    at backends/meta-backend.c line 133

(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;"
Comment 2 Erik Welander 2017-06-18 18:41:21 UTC
Created attachment 353998 [details] [review]
Patch to fix the segfault
Comment 3 Jonas Ådahl 2017-06-19 01:33:57 UTC
This is pretty much what https://bugzilla.gnome.org/review?bug=730551&attachment=349706 does (part of bug 730551)
Comment 4 Erik Welander 2017-06-20 16:40:09 UTC
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.
  • #0 meta_window_move_between_rects
    at core/window.c line 3811
  • #0 meta_window_move_between_rects
    at core/window.c line 3811
  • #1 meta_window_update_for_monitors_changed
    at core/window.c line 3583
  • #2 g_slist_foreach
  • #3 meta_screen_foreach_window
    at core/screen.c line 974
  • #4 on_monitors_changed
    at core/screen.c line 2233
  • #5 ffi_call_unix64
  • #6 ffi_call
  • #7 g_cclosure_marshal_generic
  • #8 g_closure_invoke
  • #9 0x00007eff24b22462 in
  • #10 g_signal_emit_valist
  • #11 g_signal_emit_by_name
  • #12 meta_monitor_manager_notify_monitors_changed
    at backends/meta-monitor-manager.c line 1747
  • #13 meta_monitor_manager_rebuild_derived
    at backends/meta-monitor-manager.c line 1857
  • #14 meta_monitor_manager_xrandr_handle_xevent
    at backends/x11/meta-monitor-manager-xrandr.c line 1675
  • #15 meta_backend_x11_cm_handle_host_xevent
    at backends/x11/cm/meta-backend-x11-cm.c line 335
  • #16 meta_backend_x11_handle_host_xevent
    at backends/x11/meta-backend-x11.c line 238
  • #17 handle_host_xevent
    at backends/x11/meta-backend-x11.c line 265
  • #18 x_event_source_dispatch
    at backends/x11/meta-backend-x11.c line 345
  • #19 g_main_context_dispatch
  • #20 0x00007eff24836640 in
  • #21 g_main_loop_run
  • #22 meta_run
    at core/main.c line 648
  • #23 main

Comment 5 Erik Welander 2017-06-20 16:41:48 UTC

*** This bug has been marked as a duplicate of bug 730551 ***
Comment 6 Jonas Ådahl 2017-06-21 02:28:48 UTC
(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.
Comment 7 Anatol Pomozov 2017-07-19 05:55:00 UTC
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.
Comment 8 Vasilis Liaskovitis 2018-02-16 16:11:08 UTC
I 've seen the same crash and backtrace as comment#4, but on older mutter 3.20

gdb) bt
  • #0 meta_workspace_get_onmonitor_region
    at core/workspace.c line 1054
  • #1 setup_constraint_info
  • #2 meta_window_constrain
  • #3 meta_window_move_resize_internal
  • #4 meta_window_move_resize_frame
    at core/window.c line 3827
  • #5 g_slist_foreach
    from /usr/lib64/libglib-2.0.so.0
  • #6 meta_screen_foreach_window
    at core/screen.c line 917
  • #7 on_monitors_changed
    at core/screen.c line 2405
  • #8 ??
    from /usr/lib64/libffi.so.4
  • #9 ??
    from /usr/lib64/libffi.so.4
  • #10 g_cclosure_marshal_generic
    from /usr/lib64/libgobject-2.0.so.0
  • #11 g_closure_invoke
    from /usr/lib64/libgobject-2.0.so.0
  • #12 ??
    from /usr/lib64/libgobject-2.0.so.0
  • #13 g_signal_emit_valist
    from /usr/lib64/libgobject-2.0.so.0
  • #14 g_signal_emit_by_name
    from /usr/lib64/libgobject-2.0.so.0
  • #15 meta_monitor_manager_rebuild_derived
    at backends/meta-monitor-manager.c line 1410
  • #16 meta_monitor_manager_xrandr_handle_xevent
    at backends/x11/meta-monitor-manager-xrandr.c line 1507
  • #17 handle_host_xevent
    at backends/x11/meta-backend-x11.c line 327
  • #18 x_event_source_dispatch
    at backends/x11/meta-backend-x11.c line 387
  • #19 g_main_context_dispatch
    from /usr/lib64/libglib-2.0.so.0
  • #20 ??
    from /usr/lib64/libglib-2.0.so.0
  • #21 g_main_loop_run
    from /usr/lib64/libglib-2.0.so.0
  • #22 meta_run
    at core/main.c line 537
  • #23 ??
  • #24 __libc_start_main
    from /lib64/libc.so.6
  • #25 ??

(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.
Comment 9 GNOME Infrastructure Team 2021-07-05 13:48:27 UTC
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.