swaywm / sway

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

crash on switch to moved-out-of workspace #6000

Open diagonalisability opened 3 years ago

diagonalisability commented 3 years ago

This is a pretty niche bug, so it's not exactly workflow-breaking.

My guess: sway is trying to arrange the window in a workspace that no longer exists, so this is a use-after-free. The fix is probably to make sure that workspaces don't get destroyed while the tiling window move indicator is inside that workspace.

diagonalisability commented 3 years ago

I tried fixing this bug here: https://github.com/swaywm/sway/compare/master...diagonalisability:fix-issue-6000 This fix causes some very strange behaviour though, because after a tiling window move, sway focuses the moved window, which is now in a different workspace. Creating a second window, for example, switches the current workspace to the one where the first window was moved to, since sway creates a new window in the same workspace as the focused window, and then focuses the new window. Perhaps moving a tiling window shouldn't focus it? I'm not sure what the correct behaviour is.

emersion commented 3 years ago

Maybe ASan will tell you more about the use-after-free. See the wiki for instructions to build with ASan

Can't the seatop listen on the container/node destroy event?