swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.64k stars 1.11k forks source link

SEGV during lid switch (?) #6727

Open alxchk opened 2 years ago

alxchk commented 2 years ago

Sway version: current git (414950bbc8e833362a689cc11720855e8edd1323)

.. billions of same lines ..

01:23:29.817 [ERROR] [sway/desktop/layer_shell.c:629] no output to auto-assign layer surface 'notifications' to Process 1175 (sway) of user 1000 dumped core.


- **Stack Trace:**
[bt-full.txt](https://github.com/swaywm/sway/files/7766911/bt-full.txt)

Interesting parts:
502          struct wlr_output *wlr_output = layer->layer_surface->output;

503 struct sway_output *output = wlr_output->data; 504 output_damage_surface(output, ox, oy, surface, whole);

Crash at line 503.

(gdb) print *layer->layer_surface
$6 = {
  surface = 0x55c8f7eb7d10,
  output = 0x0, <<<<--------------- OUTPUT IS NULL
  resource = 0x55c8f7ef8220,
  shell = 0x55c8f78dda00,
  popups = {
    prev = 0x55c8f7f3f908,
    next = 0x55c8f7f3f908
  },
  namespace = 0x55c8f7fb28f0 "waybar",
  added = true,
  configured = true,
  mapped = true,
  configure_list = {
    prev = 0x55c8f7f0c590,
    next = 0x55c8f7f0c590
  },
  current = {
    committed = 0,
    anchor = 14,
    exclusive_zone = 17,
    margin = {
      top = 0,
      right = 0,
      bottom = 0,
      left = 0
    },
    keyboard_interactive = ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_NONE,
    desired_width = 0,
    desired_height = 17,
    layer = ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM,
    configure_serial = 20188,
    actual_width = 1920,
    actual_height = 17
  },
  pending = {
    committed = 0,
    anchor = 14,
    exclusive_zone = 17,
    margin = {
      top = 0,
      right = 0,
      bottom = 0,
      left = 0
    },
    keyboard_interactive = ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_NONE,
    desired_width = 0,
    desired_height = 17,
    layer = ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM,
    configure_serial = 20188,
    actual_width = 1920,
    actual_height = 17
  },
  surface_destroy = {
    link = {
      prev = 0x55c8f7c06828,
      next = 0x55c8f7eb7fe0
    },
    notify = 0x7f1c2a2fa6e0 <handle_surface_destroyed>
  },
  events = {
    destroy = {
      listener_list = {
        prev = 0x55c8f7f1a758,
        next = 0x55c8f7f1a758
      }
    },
    map = {
      listener_list = {
        prev = 0x55c8f7f1a770,
        next = 0x55c8f7f1a770
      }
    },
    unmap = {
      listener_list = {
        prev = 0x55c8f7f1a788,
        next = 0x55c8f7f1a788
      }
    },
    new_popup = {
      listener_list = {
        prev = 0x55c8f7f1a7d0,
        next = 0x55c8f7f1a7d0
      }
    }
  },
  data = 0x55c8f7f1a740
}
alxchk commented 2 years ago

Usually I use laptop in dock, so I don't want to have this output once lid is closed. However, if undocked, then closing lid means no active outputs at all. Looks like this can be painful. I tried to reproduce with manual enable/disable output, and while not crashed, at some point I was not able even to enable this single output.