Windows Version
Microsoft Windows [Version 10.0.26310.28089]
WSL Version
2.9.9.0
Are you using WSL 1 or WSL 2?
Kernel Version
No response
Distro Version
6.18.40.1-1
Other Software
Not related
Repro Steps
This is not a deterministic issue. This was found during development. Where wsl --shutdown always returns
Not enough memory resources are available to complete this operation.
Error code: Wsl/E_OUTOFMEMORY
The original trigger is not captured.
Expected Behavior
wsl shuts down normally.
Actual Behavior
The error has two folds:
-
The service stuck in the stopping state
The wsl VM was stopped. But the wslc VM was not. Initial analysis shows this could be a dead lock in the wslc shutdown logic.
-
The wsl --shutdown call translates the stopping state to OOM.
|
catch (...) |
|
{ |
|
const auto result = wil::ResultFromCaughtException(); |
|
|
|
// Note: S_FALSE will cause COM to retry if the service is stopping. |
|
return result == CO_E_SERVER_STOPPING ? S_FALSE : result; |
|
} |
This logic here translates the stopping state to S_FALSE. And the function is returned with S_FALSE and ppCreated = NULL. This may have caused COM to treat this as an OOM. There was system memory pressure during the repro.
Diagnostic Logs
Captured wsl log and wsl service dumps were emailed.
Windows Version
Microsoft Windows [Version 10.0.26310.28089]
WSL Version
2.9.9.0
Are you using WSL 1 or WSL 2?
Kernel Version
No response
Distro Version
6.18.40.1-1
Other Software
Not related
Repro Steps
This is not a deterministic issue. This was found during development. Where wsl --shutdown always returns
The original trigger is not captured.
Expected Behavior
wsl shuts down normally.
Actual Behavior
The error has two folds:
The service stuck in the stopping state
The wsl VM was stopped. But the wslc VM was not. Initial analysis shows this could be a dead lock in the wslc shutdown logic.
The wsl --shutdown call translates the stopping state to OOM.
WSL/src/windows/service/exe/LxssUserSessionFactory.cpp
Lines 168 to 174 in 00df65a
This logic here translates the stopping state to S_FALSE. And the function is returned with S_FALSE and ppCreated = NULL. This may have caused COM to treat this as an OOM. There was system memory pressure during the repro.
Diagnostic Logs
Captured wsl log and wsl service dumps were emailed.