Mapping a lot of windows at once using wl_shm gets Xwayland killed
Description
When Xwayland cannot use glamor and GBM (typically when GL is implemented in software with LLVM as when running in a virtual machine), it falls back to wl_shm
to pass its buffers around.
In that case, if the X11 clients creates a whole lot of X11 windows at once, flooding the Wayland compositor as in xorg/xserver#1222, Wayland will abort taking down Xwayland
with the following error:
request could not be marshaled: can't send file descriptor
This message originates from wl_connection_put_fd()
because wl_connection_flush()
returned -1
as it hits the error case with errno
being EAGAIN
(typically the Wayland compositor cannot cope and the socket got full).
Trying to reconnect (as with xorg/xserver!756) will flood the Wayland compositor even more so this is unlikely to help in that particular case.
After some discussions on irc on #wayland with @emersion, @jadahl and @DemiMarie, Jonas suggested a possible solution for now would be to have an unbound output buffer for Wayland clients (which is different from #159) as the needs for clients are different from the ones for the server, it is not the same issue.
FWIW, I tried @mstoeckl's https://gitlab.freedesktop.org/mstoeckl/wayland/-/commits/variable-connection branch but to no avail, it still fails with EGAIN
in sendmsg()
called from wl_connection_flush()
so maybe that branch doesn't account for all cases.