Repository navigation
Description
Windows Version
Microsoft Windows [Version 10.0.26300.10075]
WSL Version
3.0.5.0
Are you using WSL 1, WSL 2, or WSLC?
- WSL 2
- WSL 1
- WSLC
Kernel Version
6.18.58.1-microsoft-standard-WSL2 (stock). Also reproduces on a custom build of the same version.
Distro Version
Ubuntu 26.04.1 LTS, systemd enabled
Other Software
Python 3.14.4 in the distro (stdlib only). Host: 28 logical CPUs, 64 GB RAM.
.wslconfig during the repro:
[wsl2]
processors=18
memory=40GB
swap=24GB
networkingMode=Consomme
vmIdleTimeout=999999999
[general]
instanceIdleTimeout=999999999
[experimental]
autoMemoryReclaim=GradualI have not tried a config with only networkingMode=Consomme.
Repro Steps
- Set
networkingMode=Consomme, runwsl --shutdown, start the distro, and confirm withwslinfo --networking-mode. - Save
single_bind.py:
import socket, time
start = time.monotonic()
with socket.socket() as s:
s.bind(("0.0.0.0", 0))
s.listen(1)
print(f"bind+listen took {time.monotonic() - start:.3f}s")- Save
bind_stress.py. It runs 64 threads × 500 ephemeral-port bind+listen calls, alternating IPv4 and IPv6, which is roughly what a parallel build or test run does:
import socket, time
from concurrent.futures import ThreadPoolExecutor
def worker(_):
ok = err = 0
for i in range(500):
fam = socket.AF_INET6 if i % 2 else socket.AF_INET
host = "::" if i % 2 else "0.0.0.0"
with socket.socket(fam, socket.SOCK_STREAM) as s:
try:
s.bind((host, 0)); s.listen(1); ok += 1
except OSError:
err += 1
return ok, err
start = time.monotonic()
with ThreadPoolExecutor(64) as pool:
r = list(pool.map(worker, range(64)))
print(f"ok={sum(x[0] for x in r)} errors={sum(x[1] for x in r)} in {time.monotonic() - start:.1f}s")- Run:
python3 single_bind.py
timeout 90 python3 bind_stress.py
python3 single_bind.py- Repeat with
networkingMode=natfor comparison.
Expected Behavior
bind() and listen() return promptly regardless of load, as they do under NAT. Same machine, same distro, stock kernel, NAT:
baseline: bind+listen took 0.000s
round 1..5: ok=32000 errors=0 in 8.5-8.7s each (160,000 calls total)
after: bind+listen took 0.000s
Actual Behavior
Under Consomme, starting from a fresh wsl --shutdown, with the stock kernel:
baseline: bind+listen took 0.015s
burst: stalled, killed by timeout after 90s
after: bind+listen took 0.989s
The damage persists after the load stops. 15 minutes later a single bind() still took 0.998s, and it stays that way until the WSL service is restarted.
In real use (parallel builds), WSL runs normally for 30 minutes or more after a Windows boot, then:
- commands in an open shell stop returning;
- new
wsl.exeinvocations hang; wsl --shutdownruns for minutes without returning;- eventually the terminal closes with:
This operation returned because the timeout period expired.
Error code: Wsl/Service/ERROR_TIMEOUT
[process exited with code 4294967295 (0xffffffff)]
(translated from a pt-BR system), after which WSL does not start again until Windows reboots. Force-stopping wslservice.exe and vmwp.exe from an elevated shell recovers it without a reboot.
What the guest shows during the full hang. wsl --debug-shell still responds, so I collected this there:
- The guest kernel is healthy: SysRq
wlists no blocked tasks, memory and IO pressure are 0, swap is unused, andvmmemWSLis idle. - The distro's
init-systemd(Ubuntu)(the WSL init that launches new sessions),systemd --userandsystemd-udevdare all parked inseccomp_do_user_notificationon syscall 49 (bind). - The process holding the
anon_inode:seccomplistener fd islocalhost --port-tracker-fd 8 --bpf-fd 10 --netlink-fd 9 --localhost-relay -1 --networking-mode 4. Its main thread waits invsock_connectible_wait_data(recvfrom), and itsSecCompDispatchandGnsPortTrackerthreads are infutex_do_wait. It appears to be waiting for a host reply that never arrives. - During the synthetic repro, all 64 stress threads were in
seccomp_do_user_notificationonbind(49) orlisten(50). They survived SIGTERM fromtimeoutand only went away with SIGKILL.
At about 1 s per intercepted bind(), a workload that binds thousands of sockets, or several processes binding concurrently, stalls for hours. The WSL init's own bind() goes through the same interception, which would explain why new sessions and wsl --shutdown hang too. In the synthetic repro, with no other binds queued, wsl --shutdown still returned (6.7 s). While the stress test ran, the host's wslservice.exe handle and thread counts did not grow (588 handles, 15 threads), and no host TCP/UDP endpoints were owned by WSL processes.
Under Consomme the stress test also hits EADDRINUSE on listen() for ephemeral ports before it stalls, which looks like #42352.
Workaround: networkingMode=nat.
Diagnostic Logs
None attached. I can collect collect-wsl-logs.ps1 -LogProfile networking during a hang if the team needs them.
Activity
github-actions commentedon Nov 26, 2026
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:
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 networkinginstead, following the instructions in Collect WSL logs for networking issuesOnce 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 wsl-gh-logs@microsoft.com 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'.
juliopolycarpo commentedon Nov 27, 2026
/emailed-logs
I sent the logs to wsl-gh-logs@microsoft.com with the subject "Logs for #42372". They come from
collect-wsl-logs.ps1(default profile) undernetworkingMode=Consomme, captured during the repro above: 5 bursts of 64 threads × 500 bind+listen calls.From the trace:
bind()calls failed in Consomme: 824 with WSAEACCES (10013) and 12 with WSAEADDRINUSE (10048). A 10013 frombind()on Windows usually means the port is in an excluded port range; I haven't matched the failing ports againstnetsh int ipv4 show excludedportrange.The capture shows only the slow path. The full hang, where the port tracker stops answering and
wsl --shutdownnever returns, did not occur during it. I can capture that state on request.github-actions commentedon Nov 27, 2026
Diagnostic information