swaywm / sway

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

Sway crashes in wl_event_loop_dispatch #6758

Open tigerjack opened 2 years ago

tigerjack commented 2 years ago
(gdb) bt full
#0  0x00007f0f5c9061c8 in wl_event_loop_dispatch () at /usr/lib/libwayland-server.so.0
#1  0x00007f0f5c903d37 in wl_display_run () at /usr/lib/libwayland-server.so.0
#2  0x000055816038a97b in  ()
#3  0x00007f0f5c619b25 in __libc_start_main () at /usr/lib/libc.so.6
#4  0x000055816038acee in  ()
[011 17:40:42.468879] [glfw error 65544]: Wayland: fatal display error: Broken pipe
(EE) failed to read Wayland events: Broken pipe
Gdk-Message: 17:40:42.679: Error reading events from display: Broken pipe
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Sandbox: Unexpected EOF, op 2 flags 00 path /home/simone/.config/xkb
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Sandbox: Unexpected EOF, op 2 flags 00 path /usr/share/X11/xkb
xkbcommon: ERROR: failed to add default include path /usr/share/X11/xkb
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
(EE) could not connect to wayland server
emersion commented 2 years ago

Please provide a stack trace. You can do so by compiling from source, reproducing the crash and then running coredumpctl gdb and then bt full.

Here are some instructions to compile from source: https://github.com/swaywm/sway/wiki/Development-Setup#compiling-as-a-subproject

emersion commented 2 years ago

Maybe related: https://github.com/swaywm/sway/issues/6570

tigerjack commented 2 years ago

Please provide a stack trace. You can do so by compiling from source, reproducing the crash and then running coredumpctl gdb and then bt full.

Here are some instructions to compile from source: https://github.com/swaywm/sway/wiki/Development-Setup#compiling-as-a-subproject

As said, I don't have a stack trace and neither a consistent way to reproduce the issue. Even if I launch it again with stack trace, I don't know if and when the problem will happen again.

tigerjack commented 2 years ago

I am using the development version since a few days (sway version 1.8-dev-d6f8820a (Jan 13 2022, branch 'master')) and the problem seems to not appear anymore. I'll keep this open for a while just to be sure.

spion commented 1 month ago

I'm not sure whether its the same issue, but I was able to get more extensive debug symbols here

(gdb) bt
#0  0x00007771d5a480a0 in wl_event_loop_dispatch (loop=0x5c73424370e0, timeout=<optimized out>, timeout@entry=-1) at ../wayland-1.23.0/src/event-loop.c:1105
#1  0x00007771d5a4a10f in wl_display_run (display=0x5c7342436ff0) at ../wayland-1.23.0/src/wayland-server.c:1530
#2  0x00005c731234dcd5 in server_run (server=<optimized out>) at ../sway-1.9/sway/server.c:398
#3  main (argc=<optimized out>, argv=0x7ffe5b5372e8) at ../sway-1.9/sway/main.c:415

Not sure if its helpful without logs. If not, I'll try to get those too and report back.

Edit: to clarify, this usually happens if another program (client) dies and/or dumps core. My guess is there may be a race condition where the fd source has already been freed because the client went away, but the event ptr is still around.