Repository navigation
Description
Environment
- WSL 2.7.11.0, kernel 6.18.33.2-microsoft-standard-WSL2, WSLg 1.0.73.2
- Windows 10.0.26200.9445
- Ubuntu distro with
[boot] systemd=true
What happens
The distro's init (init-systemd(Ubuntu), PID 2 inside the pid namespace) dies with SIGABRT. Afterwards every new wsl.exe -d Ubuntu session fails immediately with Wsl/Service/E_UNEXPECTED, interop calls from inside the distro hang, VS Code Remote loops on reconnect; systemd inside the distro keeps running. Only wsl --terminate Ubuntu recovers.
Three occurrences in 24 hours, identical crash dumps (%LOCALAPPDATA%\Temp\wsl-crashes\wsl-crash-*-2-_init-6.dmp, "pid: 2, executable: !init, signal: 6"). dmesg each time:
WSL (2 - Interop) ERROR: SendMessage:182: Failed to write message LxMessageResultBool. Channel: InteropServer
libc++abi:
terminating due to uncaught exception of type wil::ResultException: Broken pipe @C:/__w/1/s/src/shared/inc\SocketChannel.h:183 (SendMessage)
init: Interop: potentially unexpected fatal signal 6.
WSL (8531 - CaptureCrash): Capturing crash for pid: 2, executable: !init, signal: 6, port: 50005
One of the three additionally logged, right before the abort:
WSL (2 - Interop) ERROR: CreateLoginSession:2758: Timed out waiting for user session for uid=0
Where in the source (main as of 2026-09-11, eaa69e7)
src/linux/init/config.cpp, ConfigHandleInteropMessage, case LxInitMessageCreateLoginSession:
bool success = false;
auto sendResponse = wil::scope_exit([&]() { Transaction.SendResultMessage<bool>(success); });
...
success = CreateLoginSession(Config, ..., CreateSession->Uid);CreateLoginSession can block for up to boot.initTimeout (10 s default) polling systemctl is-active user@<uid>.service, on the single "Interop" worker thread. If the client (the session leader /init that wsl.exe started) has gone away meanwhile because the Windows-side caller timed out or was killed, SendResultMessage throws wil::ResultException (EPIPE). It throws from inside the wil::scope_exit lambda, whose destructor is noexcept, so the surrounding try { ... } CATCH_LOG() never sees it and std::terminate takes the whole init down.
The Interop thread is also single and unbounded: for (;;) { Accept; ReceiveTransaction; ReceiveOrClosed; handle } with no receive timeout, so one stalled client (in our case a process throttled by a cgroup memory.high limit) queues every other session start behind it, which is what makes callers give up and close their end.
Reproduction
wsl --terminate Ubuntu- Make the first root session slow, for example a systemd that needs more than 10 s to reach
[email protected](we hadStartup finished in 18.6s), or any load that delays it. - From PowerShell:
$j = Start-Job { wsl -d Ubuntu -u root -e true }; Wait-Job $j -Timeout 3; Stop-Job $j - When
CreateLoginSessiontimes out (or merely finishes) and writes its bool result, init aborts and the distro is unusable until terminated.
Suggested fix
- Send the result inside the
trybody instead of from awil::scope_exit, or wrap the send in the lambda with aCATCH_LOG(); a client that hung up must not take init with it. - Ideally, bound
ReceiveTransaction/ReceiveOrClosedon the Interop server socket with a timeout, so one stalled client cannot block every other session start.
Mitigation we use meanwhile (for others hitting this)
loginctl enable-linger root (and for the default user), so user@<uid>.service is active before the first session and CreateLoginSession returns at once; keep systemd's boot under boot.initTimeout; never wrap wsl.exe -d ... in a kill-on-timeout.
Activity
github-actions commentedon Sep 12, 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 [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'.
chemwolf6922 commentedon Sep 14, 2026
Hi Davide (@blackdiamond6390) .
The scope_exit throw issue was fixed in #40691. And the zombie distro state was fixed in #40433. Both are in the pre-release versions. And not backported to 2.7.x. If possible, please update to the latest pre-release version. Thanks.
However, the trigger of the issue is still not clear. (Why did the sendMessage fail). Please try capture the repro with the log collection script if possible. That will help solve that part.
meisenbraun commentedon Sep 19, 2026
Hitting this in the wild, twice in three days. The trigger was the OpenAI Codex desktop app, not a synthetic repro.
Environment: Windows 11, WSL2 kernel 6.6.114.1-microsoft-standard-WSL2, Ubuntu with
systemd=true. The default user (uid 1000) has linger enabled and[email protected]is already active, so this doesn't depend on a slow first login.Signature (identical both times, 2026-09-16 18:50:42 and 2026-09-18 20:47:30):
Effect: the Interop worker never comes back. Sessions that are already open keep working, but until the distro is terminated:
wsl.exe -d Ubuntu -- <cmd>from Windows hangs indefinitelycmd.exe /c ver) fails withUtilAcceptVsock:273: accept4 failed 110wsl.exe -l -vstill reports the distro as Running, which makes this hard to diagnoseTrigger: the Codex desktop app runs git operations against a WSL project by starting many
wsl.exeprocesses at once (its crash-reporter breadcrumbs show about 20 within 200 ms) and killing the ones that don't finish in time. A UI action in Codex came 6 s before the crash. That's the same "client disconnects before the reply" condition as your PowerShell-timeout repro, but from a real-world client.Because of the single-threaded worker, a burst of concurrent session creations queues up, so a client-side timeout is much more likely to fire before its reply arrives. One such disconnect takes down interop for the whole distro until
wsl --terminate.Request: handle a failed
SendResultMessagewithout terminating (the throw inside thenoexceptscope_exitis the direct cause), and ideally restart the Interop worker if it dies.chemwolf6922 commentedon Sep 21, 2026
Hi Matthew Eisenbraun (@meisenbraun) . If possible, please try capture the repro with the collect-wsl-logs script and share the log. Thanks.
microsoft-github-policy-service commentedon Sep 28, 2026
This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-file it as a new issue.
Thank you!
test(live): resolve the bundled ripgrep in the lazy-tool live test
test: bash-spawning tests use Git Bash on Windows, never WSL
fix(exec): bare bash on Windows runs Git Bash, never the WSL launcher