WSL icon indicating copy to clipboard operation
WSL copied to clipboard

WSL 2.5+ slows dotnet when attaching debugger

Open sgqkmd opened this issue 5 months ago • 8 comments

Windows Version

Microsoft Windows [Version 10.0.26100.3624]

WSL Version

2.6.0.0

Are you using WSL 1 or WSL 2?

  • [x] WSL 2
  • [ ] WSL 1

Kernel Version

No response

Distro Version

Ubuntu 24.04

Other Software

dotnet 8 vscode (vsdbg) netcoredbg

Repro Steps

  • Start WSL2
  • Start a rather large dotnet8 application
  • Attach a debugger, either vsdbg via VScode WSL or netcoredbg

Expected Behavior

The application should run smoothly or just about the same as before the debugger was attached.

Actual Behavior

The application is about 100x slower (literally) after the debugger is attached.

Diagnostic Logs

acl.txt appxpackage.txt bcdedit.txt HKCU.txt HKLM.txt optional-components.txt P9NP.txt windows-version.txt Winsock2.txt wpr.txt wslservice.txt wslsupport-impl.txt wslsupport-proxy.txt

WslLogs-2025-07-03_10-13-54.zip

sgqkmd avatar Jul 03 '25 10:07 sgqkmd

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs

Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The script will output the path of the log file once done.

If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here

Once completed please upload the output files to this Github issue.

Click here for more info on logging If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

github-actions[bot] avatar Jul 03 '25 10:07 github-actions[bot]

Workaround: download and install WSL 2.4.13 from https://github.com/microsoft/WSL/releases, no uninstall needed.

sgqkmd avatar Jul 03 '25 10:07 sgqkmd

/logs

OneBlue avatar Oct 17 '25 02:10 OneBlue

/logs

I have already posted the logs??

sgqkmd avatar Oct 20 '25 11:10 sgqkmd

@sgqkmd: I don't see the .etl file in the logs you shared. Can you share the .zip that the log script generates ?

/logs

OneBlue avatar Oct 20 '25 18:10 OneBlue

@sgqkmd: I don't see the .etl file in the logs you shared. Can you share the .zip that the log script generates ?

/logs

Done

sgqkmd avatar Oct 21 '25 07:10 sgqkmd

Diagnostic information
Issue was edited and new log file was found: https://github.com/user-attachments/files/23015229/WslLogs-2025-07-03_10-13-54.zip
Detected appx version: 2.6.0.0

github-actions[bot] avatar Oct 21 '25 07:10 github-actions[bot]

I have the same problem with C++ projects. In some cases debugging is practically impossible since each 'step' takes 30s or more to refresh the local variable view. Running WSL 2.6.1

JobMulderXsens avatar Nov 11 '25 08:11 JobMulderXsens