Crash when trying to paste the contents of the clipboard after copying large contents from an XWayland-client
Weston crashes for me when I am pasting in a wayland-native application the contents of the clipboard after copying the contents of some large file from an XWayland-client application. The issue is always reproducible with the same file, which is about 600 KiB large. Smaller files don't have this issue.
Steps to reproduce:
- Launch a IntelliJ IDEA
- Open some large text file, and copy the contents to the clipboard with CTRL+C
- Launch chromium with the ozone flags (
--enable-features=UseOzonePlatform --ozone-platform=wayland
) - Paste the contents of the clipboard into some web page
I obtained the following stack trace from the crash:
Core was generated by `weston'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007fbee2fa85c0 in xcb_get_property_value_length () from /usr/lib/libxcb.so.1
[Current thread is 1 (Thread 0x7fbef2fc48c0 (LWP 6426))]
(gdb) bt full
#0 0x00007fbee2fa85c0 in xcb_get_property_value_length () at /usr/lib/libxcb.so.1
#1 0x00007fbee2ddb18d in () at /usr/lib/libweston-9/xwayland.so
#2 0x00007fbef34f3faa in wl_event_loop_dispatch () at /usr/lib/libwayland-server.so.0
#3 0x00007fbef34f24e7 in wl_display_run () at /usr/lib/libwayland-server.so.0
#4 0x00007fbef37523b8 in wet_main () at /usr/lib/weston/libexec_weston.so.0
#5 0x00007fbef357e152 in __libc_start_main () at /usr/lib/libc.so.6
#6 0x000055d0fab8605e in ()
I am on Arch Linux, and using the official package:
❯ pacman -Qi weston
Name : weston
Version : 9.0.0-1
Description : Reference implementation of a Wayland compositor
Architecture : x86_64
URL : https://wayland.freedesktop.org/
Licenses : MIT
Groups : None
Provides : None
Depends On : glibc wayland libxkbcommon libinput libunwind pixman libdrm pam systemd-libs cairo libpng libjpeg-turbo
libwebp mesa libegl libgles glib2 pango lcms2 mtdev libx11 libxcb dbus libva libxcursor colord
libpipewire02
Optional Deps : freerdp: support rdp backend
Required By : None
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 4.89 MiB
Packager : Sébastien Luttringer <seblu@seblu.net>
Build Date : Fri 04 Sep 2020 01:41:20 PM EEST
Install Date : Sun 13 Dec 2020 02:36:04 PM EET
Install Reason : Explicitly installed
Install Script : No
Validated By : Signature
Note that the wayland compositor swaywm is also affected by this bug, as they have borrowed most of the code: https://github.com/swaywm/wlroots/issues/2548