Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runaway process when copying bitmap to clipboard #609

Closed
edburns opened this issue Dec 14, 2021 · 10 comments
Closed

Runaway process when copying bitmap to clipboard #609

edburns opened this issue Dec 14, 2021 · 10 comments
Labels
bug Something isn't working clipboard-integration Windows clipboard integration fixinbound

Comments

@edburns
Copy link
Member

edburns commented Dec 14, 2021

Environment

Windows build number: Microsoft Windows [Version 10.0.22000.318
Your Distribution version: Ubuntu 20 (from Store)
Your WSLg version: 1.0.26

Steps to reproduce

  • Start WSL2.
  • Tail weston.log.
  • Using Edge, do Ctrl-Shift-S to capture a region of the browser window to the clipboard. FWIW, I use exactly this:
    image
  • Notice that the weston.log tail starts going into runaway mode.

I also observed that if I have the bitmap in the clipboard before starting WSL2, I also get into runaway mode.

WSL logs:

20211213-wslg-runaway-process.txt

Expected behavior

I can use GNU emacs under WSLg without the system going into an unusable state.

Actual behavior

Something I am doing is triggering the system going into an unusable state where the keyboard and mouse focus keeps getting stolen several times a second, lots of content is written to the weston.log (attached), and this keeps happening until I somehow managed to get Task Manager opened, find the process "Virtual machine worker" and end it. All the while I must fight with the focus stealing.

@edburns edburns added the bug Something isn't working label Dec 14, 2021
@edburns
Copy link
Member Author

edburns commented Dec 14, 2021

Even after killing the process, I find I must reboot the machine.

@edburns
Copy link
Member Author

edburns commented Dec 14, 2021

Happened again. That's twice today.
20211213-wslg-runaway-process-609-02.txt
.

@jonhoward
Copy link

I am having the same issue. Process Explorer shows that mstsc.exe is stuck launching and terminating repeatedly and I have the same problem as @edburns with the computer becoming nearly unusable because focus keeps leaving the application I'm trying to work with. I have found that the problem starts when I use Greenshot to copy some image data into the clipboard of my PC and I can get it to stop if I can manage to copy some text into the clipboard, although that is easier said than done due to the unfocusing issue.

@edburns
Copy link
Member Author

edburns commented Dec 21, 2021

I hit this again just now. I wasn't even running an X app at the time. I had to open a Windows Command Prompt and fight the focus stealing to type wsl --shutdown. It went something like this.

w
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
s
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
l
 
-
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
-
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
 
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
s
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
h
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
u
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
t
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
[DAMN THIS THING]
d
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
o
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
w
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
n
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
[lose focus]
[click in the window to regain focus]
<Enter>
[OH. MY. GOD. THIS IS AWFUL]

@edburns
Copy link
Member Author

edburns commented Dec 21, 2021

Actually, using wsl --shutdown doesn't prevent it from happening again. Soon after next time I started WSL it happened again. This time I was able to fight with the focus stealer to execute cp /mnt/wslg/weston.log <some other place> so that it would survive the reboot. Here it is.

20211221-wslg-runaway-process-609-01.txt.gz

After rebooting the machine I am able to start WSL without the focus stealer (until it happens again)

Is there any remediation less drastic than rebooting? Why isn't wsl --shutdown sufficient?

@edburns
Copy link
Member Author

edburns commented Dec 22, 2021

I suspect my use of Ditto Clipboard may be related. Today I quit Ditto and have not re-started it since I started using WSL2 for the day and I have not been able to reproduce the runaway process by following the steps that worked in the description.

@edburns edburns changed the title Runaway process, not sure what causes it. Killing "Virtual machine worker" in task manager stops the runaway Runaway process when copying bitmap to clipboard Dec 22, 2021
@hideyukn88 hideyukn88 added clipboard-integration Windows clipboard integration fixinbound labels Jan 5, 2022
@jonhoward
Copy link

While waiting on a fix to be available, is anyone able to advise on how I could continue using WSL but without the GUI part so I can use my PC without being affected by this issue? Running Linux GUI apps is not a day-to-day need I have, but using the clipboard for image data is.

@Masamune3210
Copy link

could just disable wsl if you dont need linux apps for now until the issue is fixed?

@jonhoward
Copy link

No, I believe disabling WSL entirely would prevent me from running Docker containers.

@Masamune3210
Copy link

Ah, yeah, you are probably right , was just throwing the idea out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working clipboard-integration Windows clipboard integration fixinbound
Projects
None yet
Development

No branches or pull requests

4 participants