Skip to content

wslservice stuck in stopping state & wsl --shutdown shows the error as OOM #41449

Closed

Description

Windows Version

Microsoft Windows [Version 10.0.26310.28089]

WSL Version

2.9.9.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

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:

  1. 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.

  2. 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.

Activity

  1. github-actions commented on Aug 26, 2026

    @github-actions
    Contributor

    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'.

  2. chemwolf6922 commented on Aug 26, 2026

    @chemwolf6922
    ContributorAuthor

    /emailed-logs

  3. github-actions commented on Aug 26, 2026

    @github-actions
    Contributor
    Diagnostic information
    Found '/emailed-logs', adding tag 'emailed-logs'
    
  4. dkbennett commented on Oct 9, 2026

    @dkbennett
    Member

    Fixed by #41460

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions