Smithay / smithay-clipboard

Provides access to the wayland clipboard for client applications
MIT License
28 stars 11 forks source link

Alacritty crashes due to smithay-clipboard? #15

Closed primeos closed 4 years ago

primeos commented 4 years ago

I just lost all my Alacritty terminals (one after another as soon as I tried to switch to them, they didn't crash all at once) on one of my Sway workspaces (the other instances where unaffected).

I got the following (partial) backtraces: https://gist.github.com/primeos/9838189b84fd5d7d33726c86ed6f08b7

I'll try to reproduce these crashes, but I'm not sure if that'll work out.

This is probably related to https://github.com/Smithay/wayland-rs/issues/203. But I noticed that the error messages and backtraces are not the same as originally in https://github.com/alacritty/alacritty/issues/2156.

As an alternative "fix" would it maybe be possible to simply try to ignore invalid outputs instead of having to panic or does the clipboard functionality a big dependency on them?

elinorbgr commented 4 years ago

This is probably not related to smithay-clipboard itself, given it does not interact with outputs at all. Its appearance in the backtraces is accidental: smithay-clipboard runs on its own thread, and then panics when trying to dispatch wayland messages due to the protocol error that occured earlier. In case of a protocol error, the rust backtraces don't really contain useful information. Only the output of running the program with WAYLAND_DEBUG=1 does.

Also, note that https://github.com/Smithay/wayland-rs/issues/203 is a purely server-side issue, nothing can be done about it client-side, as the client cannot know that an output is invalid at the moment it tries to bind it, due to the race. Using the WAYLAND_DEBUG=1 log, we can figure out if the client is doing something wrong, but if it is not the case there is nothing that can be done apart from waiting for the compositor to release an update fixing the issue.

In the case of sway, wlroots introduced a fix for this in February ( https://github.com/swaywm/wlroots/commit/29726e6816e47adb199f2c84fbb4365e98bbeb6c ), so we can expect the next release of sway to have this fixed.

primeos commented 4 years ago

This is probably not related to smithay-clipboard itself, given it does not interact with outputs at all.

Right, it doesn't interact with outputs (which would also be strange in this case). I should've checked that first. Sorry :o

Anyway, huge thanks for your very quick and awesome response :) That was very helpful and much appreciated!

(PS: And sorry for not closing this issue / responding. IIRC I wanted too look more into this but lacked the time and then forgot about it...)