踩到了一个win11在wsl2下的一个bug,具体在系统上的体现是是突然之间会cpu高占用,并且光标会一直跳动,无法聚焦。

打开了/var/log/syslog之后查看日志,发现有如下内容:

Apr 20 13:53:18 DESKTOP kernel: [12422.705259] CPU: 5 PID: 18768 Comm: weston Not tainted 5.10.102.1-microsoft-standard-WSL2 #1
Apr 20 13:53:18 DESKTOP kernel: [12422.705270] RIP: 0033:0x7f7c19886673
Apr 20 13:53:18 DESKTOP kernel: [12422.705272] Code: 0f 18 8e 00 01 00 00 0f 18 8e 40 01 00 00 0f 18 8e 80 01 00 00 0f 18 8e c0 01 00 00 c5 fe 6f 06 c5 fe 6f 4e 20 c5 fe 6f 56 40 <c5> fe 6f 5e 60 48 81 c6 80 00 00 00 48 81 ea 80 00 00 00 c5 fd e7
Apr 20 13:53:18 DESKTOP kernel: [12422.705275] RSP: 002b:00007fff1aa3c218 EFLAGS: 00010286

复制关键字进行搜索,发现了这个issue: Unexpected fatal signal 11 #378,截止目前为止该issue是打开状态。

里面提到了复现的方式:

Hey. I think I found the exact way to replicate this.
This happens every time when copying any picture/image data to clipboard.
And you cannot run any GUI apps as weston keeps crashing until you clear the clipboard or copy simple text.
This also disables making screnshots with snipping tool.

具体到我这里是在屏幕上截图,就会复现这个情况,至于解决办法是复制一个简单的文本后,确实cpu占用会下来光标也不会乱跳恢复正常。

里面也提到了一个解决办法:

Create a file at C:\Users\YourUser\.wslconfig and insert these lines:

[wsl2]
guiApplications=false

我试了一下,Done,确实可以了!

标签: none

评论已关闭