WSL icon indicating copy to clipboard operation
WSL copied to clipboard

WSL2 restart waits 60 seconds while WSLg Xwayland is blocked in dxgkrnl

Open z-xhh opened this issue 4 weeks ago • 3 comments

Windows Version

Microsoft Windows 10.0.19045.7807

WSL Version

3.0.5.0

Are you using WSL 1, WSL 2, or WSLC?

  • [x] WSL 2
  • [ ] WSL 1
  • [ ] WSLC

Kernel Version

6.18.58.1-1

Distro Version

Alpine Linux 3.22.7 (temporary WSL 2 test distribution)

Other Software

WSLg 1.0.79 Intel UHD Graphics 770, driver 32.0.101.7077. Virtual display adapters: OrayIddDriver 17.50.19.949, ToDesk 16.44.2.509, GameViewer 15.6.5.199, and Microsoft Remote Display Adapter 10.0.19041.7802. Their involvement is unknown. The problem was initially noticed when an application attempted to restart its WSL distribution. The experiment below used a separate temporary Alpine distribution.

Repro Steps

On this host, with the system already in the affected state:

  1. Import and start a disposable Alpine 3.22.7 WSL 2 distribution with WSLg enabled. No Linux GUI app needs to be opened manually.
  2. Terminate that distribution with wsl.exe --terminate <test-distro>, then time wsl.exe -d <test-distro> -u root --exec true.
  3. In the disposable distribution, set [general] guiApplications=false in /etc/wsl.conf, terminate it, start it, and then repeat step 2. Verify that /mnt/wslg is not mounted.
  4. Set [general] guiApplications=true, terminate it, start it, and then repeat step 2. Verify that /mnt/wslg is mounted.

The initial condition that puts the host in the affected state is not yet known; this is not claimed to reproduce on a clean boot or on other machines.

Expected Behavior

The previous distribution instance and its WSLg system distribution should finish exiting, and a new instance should start without waiting for a 60-second exit timeout.

Actual Behavior

  • With WSLg enabled, the launch following termination took about 60.25 seconds. WSL reported that it timed out after 60000 ms waiting for the previous distribution process to exit and continued without confirming that it had stopped.
  • With WSLg disabled, a subsequent launch following termination took about 0.19 seconds. Re-enabling WSLg brought the 60-second wait back on the following termination/start cycle. The first launch after changing the setting still depended on the preceding instance: disabling took 60.19 seconds, while re-enabling took 0.30 seconds.
  • In a separate temporary Alpine instance, a cross-namespace process observer showed the WSLg init waiting in do_wait during reboot(RB_POWER_OFF). Its Xwayland child was in uninterruptible D state, with the stack below. The observer continued to see init waiting beyond the WSL timeout.
  • The original application restart took about 95 seconds and exceeded its 90-second timeout. The WSLg process stack of that distribution was not captured during its restart, so this report does not assert that it had the same stack.

Diagnostic Logs

The blocked Xwayland process's kernel stack from the temporary test instance:

dxgglobal_acquire_process_adapter_lock+0x20/0x30
dxgkio_enum_adapters3+0xde/0x440
dxgk_ioctl+0x66/0x110
dxgk_unlocked_ioctl+0x12/0x20
__x64_sys_ioctl+0xa1/0xf0
x64_sys_call+0x102c/0x20f0
do_syscall_64+0x6e/0xfa0
entry_SYSCALL_64_after_hwframe+0x76/0x7e

The holder of the lock and the underlying cause have not been identified. No full trace or diagnostic archive is attached.

A user reported an Xwayland wait with the same two leading stack frames in a comment on openai/codex#50971. That report concerns clipboard symptoms; a shared root cause has not been established.

z-xhh avatar Nov 04 '26 13:11 z-xhh

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-wsl-logs.ps1 -LogProfile networking instead, following the instructions in Collect WSL logs for networking issues

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

See Collect WSL logs (recommended method).

If you choose to email these logs instead of attaching them to the bug, please send them to [email protected] with the GitHub issue number in the subject, and include a link to your GitHub issue comment in the message body, and reply with '/emailed-logs'.

github-actions[bot] avatar Nov 04 '26 13:11 github-actions[bot]

/emailed-logs

The logs have been sent by email. The trace captured a 60.34-second restart timeout in a temporary Alpine distribution.

z-xhh avatar Nov 04 '26 14:11 z-xhh

Diagnostic information
Found '/emailed-logs', adding tag 'emailed-logs'

github-actions[bot] avatar Nov 04 '26 14:11 github-actions[bot]