linuxqq占用大量xwayland连接客户端

我使用的os为cachyos,但之前使用archlinux时也有类似的问题,就是linuxqq这个包提供的qq会吃满所有的xwayland连接,导致其他需要xwayland启动的程序无法正常启动,如微信、steam游戏等,具体症状如下:

启动微信:

❯ wechat
Portable daemon 14
[Warn]  Unknown option QT_QPA_PLATFORM
[Warn]  Unknown option IBUS_USE_PORTAL
[Warn]  Unknown option QT_AUTO_SCREEN_SCALE_FACTOR
[Warn]  You should supply your own .desktop file
[Warn]  Could not determine IM via environment variables
[Warn]  Could not detect accessibility bus: stat /run/user/1000/at-spi/bus: no such file or directory
[Warn]  Mapping card to renderer: surplus device ID: pci-0000:13:00.0, sysname: renderD129
Starting helper...
Got raw command line arguments:
Starting main application /opt/wechat/wechat with cmdline: 

Start counter init done
Updated tracking status:  1
Maximum number of clients reached
[0317/161546.349036:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[0317/161546.350767
process_reader_linux.cc(146)] no stack mapping
[0317/161546.350791
process_reader_linux.cc(146)] no stack mapping
[0317/161546.350813
process_reader_linux.cc(146)] no stack mapping
[0317/161546.916344:ERROR:directory_reader_posix.cc(42)] opendir /home/wang1zhen/.local/share/WeChat_Data/.xwechat/crashinfo/attachments/091fa8fb-1c8b-4ce8-aac2-80664087a5d9: No such file or directory (2)
Main process exited
All tracked processes have exited
Sent termination signal
[Warn]  Could not accept connection: accept unix /run/user/1000/portable/com.qq.weixin/portable-control/daemon: use of closed network connection
%                                                                                                         Updated tracking status:  0


wayland连接数:

❯ xlsclients | wc -l
Maximum number of clients reached
xlsclients: unable to open display ":0"
0
❯ xlsclients -al
Maximum number of clients reached
xlsclients: unable to open display ":0"
❯ lsof -U | grep -E "/tmp/.X11-unix/X[0-9]+" | awk '{print $1, $2}' | sort | uniq -c | sort -nr | head -n 10
256 Xwayland 1651
2 kwin_wayl 1549

具体占用:

❯ lsof -U 2>/dev/null | grep -v -E "Xwayland|systemd|kwin_wayl|dbus|pipewire|wireplumber" | awk '{print $1, $2}' | sort | uniq -c | sort -nr | head -n 10
251 qq 2082
63 chrome 3204
57 chrome 2314
49 steamwebh 10259
30 chrome 3235
29 chrome 3530
28 code 4506
25 code 2943
23 thunderbi 2119
19 electron 2075

可以看到在我这里qq吃掉了251个连接数,把上限挤满了,如果退出qq再重新进入就能释放掉。

有没有朋友遇到类似的问题?

大家都发现了,比如

切换到x11环境下试试呢?验证一下是软件Bug?还是在Wayland环境下对x11协议的窗口程序的兼容性问题?

有人已经试过了:

目前比较好的绕过方法是使用Wayland并且不给用Xwayland。这样剪贴板会不能用,但是不影响别的软件。

1 Like

有大佬发现可能是QQ内部的bug,给出了暂时的解决方案,参考链接:https://aur.archlinux.org/packages/linuxqq#comment-1062481

1 Like

有没有谁试过假如 patch Xserver 让它以 LRU 方式强行关掉 QQ 创建的旧连接,会不会有什么影响?

原来是QQ的锅,逆天了我最近经常遇到 vibe 的一个软件(也是xwayland用)经常打不开,我还怪 AI,直到看到日志的第一行 log,才找到这个问题。QQ 你过于逆天了啊!