You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Running wsl.exe causes "Application Info"/appinfo service to leak ~5 registry handles. Turns into a very steady leak with Docker Desktop. Hundreds of thousands of handles leaked after a week uptime. #9851
Linux version 5.15.90.1-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Fri Jan 27 02:56:13 UTC 2023
Distro Version
Ubuntu Release: 22.04
Other Software
Docker Desktop 4.17.1 (101757) is currently the newest version available.
Repro Steps
On a fresh clean install of Windows.
Install WSL2 and Ubuntu
Install Docker Desktop with WSL2 Integration
Install Process Explorer
Install Process Monitor
After those services are installed and all is running:
Using Process Explorer, locate the svchost.exe that is hosting the "Application Info" service.
Observe that it's handles are climbing up steadily while Docker Desktop is running.
Close Docker Desktop
Watch the handles stop climbing on the svchost.exe
Run wsl.exe from Powershell. Then exit. Observe that the handles increase a slight bit by 10, then drops down to a 4-5 overall increase. It never goes back down.
Expected Behavior
The "Application Info" service should return to the same number of handles after an invocation and exit of wsl.exe. This includes periodic calls to wsl.exe from applications such as "Docker Desktop".
Actual Behavior
Handle leak in svchost.exe of "Application Info" service.
Something that happens when wsl.exe is called is causing this "Application Info" svchost.exe to open some registry keys to "HKLM\SOFTWARE" and not close all the handles it opens. I'm not aware if other executables or operations that can cause this.
Process Monitor on a quiet system after running wsl.exe and exiting:
Process Explorer:
Imagine Process explorer having 100,000 of these handles and trying to display them. It can! The scroll bar gets real tiny though.
When combined with periodic calls to wsl.exe from applications such as "Docker Desktop", this can result in hundreds of thousands of leaked handles in this svchost.exe. On my installs, I've seen it go up to about 800,000 handles to "HKLM\SOFTWARE" after about a week of uptime with Docker Desktop running before my computer gets really sluggish. In exchange for about 5 - 10 minutes of downtime in Windows, I can kill the "svchost.exe" as a workaround, and wait for it to come back up sans the handles leaked.
changed the title [-]Running `wsl.exe` causes "Application Info"/`appinfo` service to leak ~5 registry handles. Turns into a very steady leak with Docker Desktop.[/-][+]Running `wsl.exe` causes "Application Info"/`appinfo` service to leak ~5 registry handles. Turns into a very steady leak with Docker Desktop. Hundreds of thousands of handles leaked after a week.[/+]on Mar 27, 2023
changed the title [-]Running `wsl.exe` causes "Application Info"/`appinfo` service to leak ~5 registry handles. Turns into a very steady leak with Docker Desktop. Hundreds of thousands of handles leaked after a week.[/-][+]Running `wsl.exe` causes "Application Info"/`appinfo` service to leak ~5 registry handles. Turns into a very steady leak with Docker Desktop. Hundreds of thousands of handles leaked after a week uptime.[/+]on Mar 27, 2023
OK, I'll run that. I've since reinstalled more stuff since then on my system though. If desired, I can try to reproduce it clean again in a Hyper-V VM with nested virtualization.
"Appinfo" looks like this in process explorer right now, 200k after a few days:
@pmartincic That said, I don't know what you mean by "us". "us" like the WSL team or Microsoft? "Appinfo" is a Windows service. It's not third-party software. I'm guessing AppInfo is not a WSL team service though.
I do have some thoughts on how this might be resolved but I'm just naive.
Let the leak continue to happen but reach out to the Docker Desktop people and help them architecture their software to not constantly periodic open/close wsl.exe or equivalent. In other words, maybe they could make it like VSCode's WSL support where a channel is opened but wsl.exe isn't being started and stopped often and keep the calls low. I suspect this might also be present in Docker Desktop alternatives like Rancher Desktop or Podman Desktop as well if those UIs/setups may also periodically be calling wsl.exe.
Coordinate with the team responsible for the Appinfo service and see how the wsl.exe process might be causing it to leak the handles. Maybe fix the wsl.exe process to not cause Appinfo to leak or fix the leak in Appinfo that happens when wsl.exe is called.
This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.
Activity
[-]Running `wsl.exe` causes "Application Info"/`appinfo` service to leak ~5 registry handles. Turns into a very steady leak with Docker Desktop.[/-][+]Running `wsl.exe` causes "Application Info"/`appinfo` service to leak ~5 registry handles. Turns into a very steady leak with Docker Desktop. Hundreds of thousands of handles leaked after a week.[/+][-]Running `wsl.exe` causes "Application Info"/`appinfo` service to leak ~5 registry handles. Turns into a very steady leak with Docker Desktop. Hundreds of thousands of handles leaked after a week.[/-][+]Running `wsl.exe` causes "Application Info"/`appinfo` service to leak ~5 registry handles. Turns into a very steady leak with Docker Desktop. Hundreds of thousands of handles leaked after a week uptime.[/+]nelsonjchen commentedon Mar 29, 2023
OK, I'll run that. I've since reinstalled more stuff since then on my system though. If desired, I can try to reproduce it clean again in a Hyper-V VM with nested virtualization.
"Appinfo" looks like this in process explorer right now, 200k after a few days:
@pmartincic That said, I don't know what you mean by "us". "us" like the WSL team or Microsoft? "Appinfo" is a Windows service. It's not third-party software. I'm guessing AppInfo is not a WSL team service though.
I do have some thoughts on how this might be resolved but I'm just naive.
microsoft-github-policy-service commentedon Mar 28, 2024
This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.
Thank you!