Changing monitor settings crashes on meta_window_wayland_move_resize_internal
This crash was reported by @iainl who, at Debconf (oops!), mirrored its display with the projector and got this crash:
#0 0x00007f97390d0727 in raise (sig=<optimised out>) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x000055a146e94a6b in ()
#2 0x00007f97390d0890 in <signal handler called> () at /lib/x86_64-linux-gnu/libpthread.so.0
#3 0x00007f97393be543 in meta_window_wayland_move_resize_internal (window=0x55a14ba98450 [MetaWindowWayland], gravity=<optimised out>, unconstrained_rect=..., constrained_rect=..., flags=(META_MOVE_RESIZE_RESIZE_ACTION | META_MOVE_RESIZE_WAYLAND_RESIZE), result=0x7ffc1ad671fc) at wayland/meta-window-wayland.c:223
#4 0x00007f97393871a3 in meta_window_move_resize_internal (window=window@entry=0x55a14ba98450 [MetaWindowWayland], flags=(META_MOVE_RESIZE_RESIZE_ACTION | META_MOVE_RESIZE_WAYLAND_RESIZE), gravity=-1, frame_rect=...)
at core/window.c:3986
#5 0x00007f97393be950 in meta_window_wayland_move_resize (window=window@entry=0x55a14ba98450 [MetaWindowWayland], acked_configure_serial=acked_configure_serial@entry=0x55a14aa959f0, new_geom=..., dx=0, dy=0)
at wayland/meta-window-wayland.c:748
#6 0x00007f97393c0f2c in meta_wayland_xdg_toplevel_commit (surface_role=0x55a14aa95a20 [MetaWaylandXdgToplevel], pending=0x55a14a432390 [MetaWaylandPendingState]) at wayland/meta-wayland-xdg-shell.c:665
#7 0x00007f97393b8e98 in meta_wayland_surface_role_commit (pending=0x55a14a432390 [MetaWaylandPendingState], surface_role=<optimised out>) at wayland/meta-wayland-surface.c:1659
#8 0x00007f97393b8e98 in meta_wayland_surface_apply_pending_state (surface=0x55a14bdc96c0 [MetaWaylandSurface], pending=0x55a14a432390 [MetaWaylandPendingState]) at wayland/meta-wayland-surface.c:716
#9 0x00007f973513edae in ffi_call_unix64 () at /usr/lib/x86_64-linux-gnu/libffi.so.6
#10 0x00007f973513e71f in ffi_call () at /usr/lib/x86_64-linux-gnu/libffi.so.6
#11 0x00007f9730c844bb in wl_closure_invoke (closure=closure@entry=0x55a14b9542b0, flags=flags@entry=2, target=<optimised out>, target@entry=0x55a14971cc20, opcode=opcode@entry=6, data=<optimised out>,
data@entry=0x55a14b8a4490) at ../src/connection.c:935
#12 0x00007f9730c80cff in wl_client_connection_data (fd=<optimised out>, mask=<optimised out>, data=0x55a14b8a4490) at ../src/wayland-server.c:406
#13 0x00007f9730c82692 in wl_event_loop_dispatch (loop=0x55a148ac4e80, timeout=timeout@entry=0)
at ../src/event-loop.c:423
#14 0x00007f97393a3037 in wayland_event_source_dispatch (base=base@entry=0x55a148d93720, callback=<optimised out>, data=<optimised out>) at wayland/meta-wayland.c:86
#15 0x00007f973ae47287 in g_main_dispatch (context=0x55a148ada7c0) at ../../../../glib/gmain.c:3177
#16 0x00007f973ae47287 in g_main_context_dispatch (context=context@entry=0x55a148ada7c0)
at ../../../../glib/gmain.c:3830
#17 0x00007f973ae474c0 in g_main_context_iterate (context=0x55a148ada7c0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimised out>) at ../../../../glib/gmain.c:3903
#18 0x00007f973ae477d2 in g_main_loop_run (loop=0x55a148d91650) at ../../../../glib/gmain.c:4099
#19 0x00007f9739374d9c in meta_run () at core/main.c:664
#20 0x000055a146e9448c in ()
#21 0x00007f9738ceeb97 in __libc_start_main (main=
0x55a146e94090, argc=1, argv=0x7ffc1ad67b28, init=<optimised out>, fini=<optimised out>, rtld_fini=<optimised out>, stack_end=0x7ffc1ad67b18) at ../csu/libc-start.c:310
#22 0x000055a146e945ca in ()
Same is reported also at FAF... By looking a bit more on the dump, it's clear that at https://gitlab.gnome.org/GNOME/mutter/blob/gnome-3-28/src/wayland/meta-window-wayland.c#L223 we've a division by 0.
As per some more debugging, is more likey a memory issue though:
13:01:08 <Laney> (gdb) print geometry_scale
13:01:08 <Laney> $1 = 0
13:03:34 <Laney> (gdb) print *window->monitor
13:03:34 <Laney> $3 = {parent = {g_type_instance = {g_class = 0x0}, ref_count = 0, qdata = 0x55a14944f680}, number = 1224949296, rect = {x = 21921, y = 35896, width = 0, height = 0}, is_primary = 0, is_presentation = 0, in_fullscreen = 0,
13:03:39 <Laney> scale = 0, transform = META_MONITOR_TRANSFORM_NORMAL, winsys_id = 0, monitors = 0x0}
(gdb) print *window
$5 = {parent_instance = {g_type_instance = {g_class = 0x55a1492595b0}, ref_count = 4, qdata = 0x55a14c4e9321}, display = 0x55a148f45a10 [MetaDisplay], screen = 0x55a148ca06b0 [MetaScreen], stamp = 4294967310,
monitor = 0x55a14ba7d050, workspace = 0x55a148e19390 [MetaWorkspace], client_type = META_WINDOW_CLIENT_TYPE_WAYLAND, surface = 0x55a14bdc96c0 [MetaWaylandSurface], xwindow = 0, frame = 0x0, depth = 24, xvisual = 0x0,
desc = 0x55a14bda21c0 "W14 (Utilities:)", title = 0x7f9718033f60 "Utilities: GDK-PixBuf Reference Manual", icon = 0x55a14b878e50, mini_icon = 0x55a1492241d0, type = META_WINDOW_NORMAL, res_class = 0x55a14921a300 "devhelp",
res_name = 0x55a14acb2040 "devhelp", role = 0x0, sm_client_id = 0x0, wm_client_machine = 0x0, startup_id = 0x0, mutter_hints = 0x0, sandboxed_app_id = 0x0, gtk_theme_variant = 0x0,
gtk_application_id = 0x55a14bb91120 "org.gnome.Devhelp", gtk_unique_bus_name = 0x55a14b427be0 ":1.144", gtk_application_object_path = 0x55a14bd49e40 "/org/gnome/Devhelp",
gtk_window_object_path = 0x55a14bc84df0 "/org/gnome/Devhelp/window/1", gtk_app_menu_object_path = 0x55a14adda1d0 "/org/gnome/Devhelp/menus/appmenu", gtk_menubar_object_path = 0x0, hide_titlebar_when_maximized = 0,
net_wm_pid = -1, xtransient_for = 0, xgroup_leader = 0, xclient_leader = 0, transient_for = 0x0, initial_workspace = 0, initial_timestamp = 0, override_redirect = 0, maximized_horizontally = 1, maximized_vertically = 1,
maximize_horizontally_after_placement = 0, maximize_vertically_after_placement = 0, minimize_after_placement = 0, tile_mode = 0, saved_maximize = 1, tile_monitor_number = -1, edge_constraints = {META_EDGE_CONSTRAINT_MONITOR,
META_EDGE_CONSTRAINT_MONITOR, META_EDGE_CONSTRAINT_MONITOR, META_EDGE_CONSTRAINT_MONITOR}, tile_hfraction = -1, preferred_output_winsys_id = 59, shaded = 0, fullscreen = 0, urgent = 0, fullscreen_monitors = {top = 0x0,
bottom = 0x0, left = 0x0, right = 0x0}, require_fully_onscreen = 1, require_on_single_monitor = 1, require_titlebar_visible = 1, on_all_workspaces = 0, on_all_workspaces_requested = 0, minimized = 0, tab_unminimized = 0,
mapped = 1, hidden = 0, visible_to_compositor = 1, known_to_compositor = 1, pending_compositor_effect = 4, iconic = 0, initially_iconic = 0, initial_workspace_set = 0, initial_timestamp_set = 0, net_wm_user_time_set = 1,
icon_geometry_set = 0, take_focus = 0, delete_window = 0, can_ping = 1, input = 1, mwm_decorated = 1, mwm_border_only = 0, mwm_has_close_func = 1, mwm_has_minimize_func = 1, mwm_has_maximize_func = 1, mwm_has_move_func = 1,
mwm_has_resize_func = 1, decorated = 0, border_only = 0, always_sticky = 0, has_close_func = 1, has_minimize_func = 1, has_maximize_func = 1, has_shade_func = 0, has_move_func = 1, has_resize_func = 1,
has_fullscreen_func = 1, skip_taskbar = 0, skip_pager = 0, wm_state_above = 0, wm_state_below = 0, wm_state_demands_attention = 0, has_focus = 0, placed = 1, denied_focus_and_not_transient = 0, showing_for_first_time = 0,
unmanaging = 0, constructing = 0, is_in_queues = 0, keys_grabbed = 0, grab_on_frame = 0, all_keys_grabbed = 0, withdrawn = 0, calc_placement = 0, shaken_loose = 0, have_focus_click_grab = 1, disable_sync = 0, attached = 0,
is_remote = 0, frame_bounds = 0x0, shape_region = 0x0, opaque_region = 0x0, input_region = 0x0, opacity = 255 '\377', extended_sync_request_counter = 0, struts = 0x0, sync_request_counter = 0, sync_request_serial = 0,
sync_request_wait_serial = 0, sync_request_timeout_id = 0, sync_request_alarm = 0, unmaps_pending = 0, stable_sequence = 15, net_wm_user_time = 243854907, user_time_window = 0, has_custom_frame_extents = 0,
custom_frame_extents = {left = 0, right = 0, top = 0, bottom = 0}, rect = {x = 0, y = 55, width = 3200, height = 1744}, saved_rect = {x = 0, y = 22, width = 0, height = 0}, unconstrained_rect = {x = 0, y = 22, width = 3200,
height = 1744}, buffer_rect = {x = 0, y = 55, width = 0, height = 0}, icon_geometry = {x = 0, y = 0, width = 0, height = 0}, size_hints = {flags = 976, x = 0, y = 0, width = 0, height = 0, min_width = 564,
min_height = 278, max_width = 2147483647, max_height = 2147483647, width_inc = 1, height_inc = 1, min_aspect = {x = 1, y = 2147483647}, max_aspect = {x = 2147483647, y = 1}, base_width = 0, base_height = 0,
win_gravity = 1}, layer = META_LAYER_NORMAL, stack_position = 0, close_dialog = 0x0, group = 0x0, compositor_private = 0x55a14ae26f50 [MetaWindowActor], attached_focus_window = 0x0, tile_match = 0x0, bypass_compositor = 0,
placement_rule = 0x0}
Edited by Marco Trevisan