Skip to content

WSL exits unexpectedly when compiling software. #40458

Open

Description

Windows Version

Microsoft Windows [Version 10.0.26200.8246]

WSL Version

2.6.3.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

Linux version 6.6.87.2-microsoft-standard-WSL2 (root@439a258ad544) (gcc (GCC) 11.2.0, GNU ld (GNU Binutils) 2.37) #1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025

Distro Version

Ubuntu 24.04.4

Other Software

Visual Studio 2022
Command Prompt
other wsl instance ( running top)

Repro Steps

Initial Configuration

  1. Install Ubuntu using the Visual Studio option to "Install WSL For Me" under the Project Menu
  2. Open a command line after the Installation completes sucessfully.
  3. sign into root on the VM using the command:
wsl -u root
  1. Install the Dependencies to build the Vulkan SDK for linux ( Documentation Here: https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html )
apt update
apt upgrade
apt install xz-utils

apt-get install libglm-dev cmake libxcb-dri3-0 libxcb-present0 libpciaccess0 \
libpng-dev libxcb-keysyms1-dev libxcb-dri3-dev libx11-dev g++ gcc \
libwayland-dev libxrandr-dev libxcb-randr0-dev libxcb-ewmh-dev \
git python-is-python3 bison libx11-xcb-dev liblz4-dev libzstd-dev \
ocaml-core ninja-build pkg-config libxml2-dev wayland-protocols python3-jsonschema \
clang-format qtbase5-dev qt6-base-dev
  1. Create the folder /opt/vulkansdk/custom_built.
  2. Change the group and file ownership of the folder created in step 5 to allow the non-root wsl user the ability to create/edit files in this path.
  3. exit out of this session.
  4. Use Visual Studio to download the Repository https://github.com/kphillisjr/VkSDKBuilder
  5. Issue the Configuration, and build commands on visual studio for wsl linux. The first build I am doing uses the default configuration for linux-debug.
  6. use the open command prompt to launch wsl.
  7. run the command top

Note: Once the first crash happens it can be reproduced with the following sequence

  1. open wsl on command line
    wsl
  2. run the following sequence.
cd ~/.vs/VkSDKBuilder/out/build/linux-debug
ninja clean
ninja

Expected Behavior

For the build script to complete without crashing wsl.

Actual Behavior

Visual Studio 2022 behavior

The build goes for a while and then eventually stops with no indication that the build actually failed.

wsl directly

The build goes for a while, and then wsl crashes out to the windows command line without any indication that wsl had crashed.

Note 1: Both build methods appear to crash at about the same area.
Note 2: I noticed that a process called VmmemWSL suddenly has a massive increase in disk usage.
Note 3: This bug happened on two different Windows 11 Computers with all updates applied.

Diagnostic Logs

dmesg.0.txt

wsl_commandline.txt

Activity

  1. github-actions commented on May 7, 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. kphillisjr commented on May 8, 2026

    @kphillisjr
    Author

    Here are the request logs. I reproduced the issue twice. The second time I made sure to catch the following error...

    -- Build files have been written to: /root/.vs/VkSDKBuilder/out/build/linux-release/build/ms_dxc
    [58/158] Performing build step for 'microsoft_dxc'
    C:\Users\kphil>wsl
    Catastrophic failure
    Error code: Wsl/Service/E_UNEXPECTED
    
    C:\Users\kphil>
    

    WslLogs-2026-05-07_19-22-16.tar.gz
    WslLogs-2026-05-07_19-34-23.tar.gz

  3. github-actions commented on May 8, 2026

    @github-actions
    Contributor
    Diagnostic information
    Multiple log files found, using: https://github.com/user-attachments/files/27501716/WslLogs-2026-05-07_19-22-16.tar.gz
    Detected appx version: 2.6.3.0
    
  4. chemwolf6922 commented on May 8, 2026

    @chemwolf6922
    Contributor

    Hi Kenney Phillis Jr. (@kphillisjr) , The dmesg shows an OOM kill. Could you please try increase the amount of memory WSL is allowed to use in .wslconfig or reduce the build parallelism of ninja with the ninja -j <n> option? Thanks.

  5. tophyr commented on May 8, 2026

    @tophyr

    This is definitely an OOM, but Feng Wang (@chemwolf6922) it's an error in the WSL Hypervisor layer. It is trivially reproducible:

    PS C:\Users\tophy> wsl --version
    WSL version: 2.5.10.0
    Kernel version: 6.6.87.2-1
    WSLg version: 1.0.66
    MSRDC version: 1.2.6074
    Direct3D version: 1.611.1-81528511
    DXCore version: 10.0.26100.1-240331-1435.ge-release
    Windows version: 10.0.26200.8037
    PS C:\Users\tophy> Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" | Select ProductName, DisplayVersion, CurrentBuild, UBR
    
    ProductName    DisplayVersion CurrentBuild  UBR
    -----------    -------------- ------------  ---
    Windows 10 Pro 25H2           26200        8037
    
    
    PS C:\Users\tophy> Get-CimInstance -ClassName Win32_Processor | Select Name, NumberOfCores, NumberOfLogicalProcessors
    
    Name                                            NumberOfCores NumberOfLogicalProcessors
    ----                                            ------------- -------------------------
    AMD Ryzen 9 7950X 16-Core Processor                        16                        32
    
    
    PS C:\Users\tophy> Get-CimInstance -ClassName Win32_ComputerSystem | Select TotalPhysicalMemory
    
    TotalPhysicalMemory
    -------------------
           136517517312
    
    
    PS C:\Users\tophy> Get-Content $env:USERPROFILE\.wslconfig
    [wsl2]
    PS C:\Users\tophy> wsl
    tophy@thor:/mnt/c/Users/tophy$ cd ~/Projects/crash-wsl/
    tophy@thor:~/Projects/crash-wsl$ ls
    crash.c
    tophy@thor:~/Projects/crash-wsl$ cat crash.c
    #include <stdlib.h>
    
    int main() {
      while (malloc(1024 * 1024));
      return 0;
    }
    
    tophy@thor:~/Projects/crash-wsl$ gcc crash.c -o crash
    tophy@thor:~/Projects/crash-wsl$ exit
    logout
    PS C:\Users\tophy> Start-Job -Name "CrashWSL" -ScriptBlock {
    >>   wsl -e /home/tophy/Projects/crash-wsl/crash
    >> }
    
    Id     Name            PSJobTypeName   State         HasMoreData     Location             Command
    --     ----            -------------   -----         -----------     --------             -------
    5      CrashWSL        BackgroundJob   Running       True            localhost            ...
    
    
    PS C:\Users\tophy> while($true) {
    >>   $w=Get-CimInstance Win32_OperatingSystem
    >>   $t = Get-Date -Format "HH:mm:ss"
    >>   $w = "$([math]::Round(($w.TotalVisibleMemorySize-$w.FreePhysicalMemory)/1MB,1))GB"
    >>   $l=wsl -e bash -c "free -h | grep Mem | awk '{print `$3}'";
    >>   "$t`tWIN: $w`tWSL: $l"
    >>   sleep 1
    >> }
    23:00:46        WIN: 37GB       WSL: 4.5Gi
    23:00:47        WIN: 38.5GB     WSL: 6.1Gi
    23:00:49        WIN: 40.1GB     WSL: 7.7Gi
    23:00:50        WIN: 41.7GB     WSL: 9.2Gi
    23:00:51        WIN: 43.2GB     WSL: 10Gi
    23:00:53        WIN: 44.8GB     WSL: 12Gi
    23:00:54        WIN: 46.3GB     WSL: 13Gi
    23:00:55        WIN: 47.9GB     WSL: 15Gi
    23:00:57        WIN: 49.5GB     WSL: 16Gi
    23:00:58        WIN: 51GB       WSL: 18Gi
    23:01:00        WIN: 52.6GB     WSL: 20Gi
    23:01:01        WIN: 54.2GB     WSL: 21Gi
    23:01:02        WIN: 55.7GB     WSL: 23Gi
    23:01:04        WIN: 57.3GB     WSL: 24Gi
    23:01:05        WIN: 58.8GB     WSL: 26Gi
    23:01:06        WIN: 60.4GB     WSL: 27Gi
    23:01:08        WIN: 62GB       WSL: 29Gi
    23:01:09        WIN: 63.5GB     WSL: 31Gi
    23:01:10        WIN: 65.1GB     WSL: 32Gi
    23:01:12        WIN: 66.6GB     WSL: 34Gi
    23:01:13        WIN: 68.2GB     WSL: 35Gi
    23:01:14        WIN: 69.8GB     WSL: 37Gi
    23:01:16        WIN: 71.3GB     WSL: 38Gi
    23:01:17        WIN: 72.8GB     WSL: 40Gi
    23:01:18        WIN: 74.4GB     WSL: 41Gi
    23:01:20        WIN: 76GB       WSL: 43Gi
    23:01:21        WIN: 77.6GB     WSL: 45Gi
    23:01:23        WIN: 79.1GB     WSL: 46Gi
    23:01:24        WIN: 80.7GB     WSL: 48Gi
    23:01:25        WIN: 82.2GB     WSL: 49Gi
    23:01:27        WIN: 83.8GB     WSL: 51Gi
    23:01:28        WIN: 85.3GB     WSL: 52Gi
    23:01:29        WIN: 86.9GB     WSL: 54Gi
    23:01:31        WIN: 88.5GB     WSL: 55Gi
    23:01:32        WIN: 90GB       WSL: 57Gi
    23:01:33        WIN: 91.6GB     WSL: 59Gi
    23:01:35        WIN: 92.9GB     WSL: 60Gi
    23:01:36        WIN: 94.2GB     WSL: 61Gi
    23:01:37        WIN: 94.8GB     WSL: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.   Error code: Wsl/Service/0x8007274c
    23:02:09        WIN: 89.3GB     WSL: 2.3Gi
    23:02:10        WIN: 84.9GB     WSL: 1.1Gi
    23:02:12        WIN: 82.1GB     WSL: 1.0Gi
    23:02:13        WIN: 78.8GB     WSL: 1.1Gi
    23:02:14        WIN: 75.6GB     WSL: 1.0Gi
    23:02:16        WIN: 73.4GB     WSL: 1.0Gi
    23:02:17        WIN: 68GB       WSL: 1.0Gi
    23:02:19        WIN: 66.3GB     WSL: 1.0Gi
    23:02:20        WIN: 61.1GB     WSL: 1.0Gi
    23:02:22        WIN: 59.3GB     WSL: 1.0Gi
    23:02:23        WIN: 54.2GB     WSL: 1.1Gi
    23:02:24        WIN: 52.1GB     WSL: 1.0Gi
    23:02:26        WIN: 46.6GB     WSL: 1.0Gi
    23:02:27        WIN: 44.8GB     WSL: 1.0Gi
    23:02:29        WIN: 41.4GB     WSL: 1.0Gi
    23:02:30        WIN: 39.6GB     WSL: 1.0Gi
    23:02:32        WIN: 37.3GB     WSL: 1.0Gi
    23:02:33        WIN: 35GB       WSL: 1.0Gi
    23:02:34        WIN: 35GB       WSL: 1.0Gi
    23:02:36        WIN: 34.9GB     WSL: 1.0Gi
    23:02:37        WIN: 35GB       WSL: 1.0Gi
    23:02:38        WIN: 35GB       WSL: 1.0Gi
    23:02:40        WIN: 34.9GB     WSL: 1.0Gi
    23:02:41        WIN: 35GB       WSL: 1.0Gi
    23:02:42        WIN: 34.9GB     WSL: 1.0Gi
    23:02:44        WIN: 34.9GB     WSL: 1.0Gi
    23:02:45        WIN: 34.9GB     WSL: 1.0Gi
    23:02:46        WIN: 34.9GB     WSL: 1.0Gi
    23:02:48        WIN: 34.9GB     WSL: 1.0Gi
    23:02:49        WIN: 34.9GB     WSL: 1.0Gi
    23:02:50        WIN: 34.9GB     WSL: 1.0Gi
    23:02:52        WIN: 34.9GB     WSL: 1.0Gi
    23:02:53        WIN: 34.9GB     WSL: 1.0Gi
    23:02:55        WIN: 34.9GB     WSL: 1.0Gi
    23:02:56        WIN: 35GB       WSL: 1.0Gi
    23:02:57        WIN: 34.9GB     WSL: 1.0Gi
    23:02:59        WIN: 34.9GB     WSL: 1.0Gi
    23:03:00        WIN: 34.9GB     WSL: 1.0Gi
    23:03:01        WIN: 34.9GB     WSL: 1.0Gi
    23:03:03        WIN: 34.9GB     WSL: 1.0Gi
    23:03:04        WIN: 34GB       WSL: 1.0Gi
    23:03:05        WIN: 34GB       WSL: 1.0Gi
    23:03:07        WIN: 34GB       WSL: 1.0Gi
    23:03:08        WIN: 34GB       WSL: 1.0Gi
    23:03:09        WIN: 34GB       WSL: 1.0Gi
    23:03:11        WIN: 34GB       WSL: 1.0Gi
    23:03:12        WIN: 34GB       WSL: 1.0Gi
    23:03:13        WIN: 34GB       WSL: 1.0Gi
    23:03:15        WIN: 34GB       WSL: 1.0Gi
    23:03:16        WIN: 34GB       WSL: 1.0Gi
    23:03:17        WIN: 34GB       WSL: 1.0Gi
    23:03:19        WIN: 34GB       WSL: 1.0Gi
    23:03:20        WIN: 34GB       WSL: 1.0Gi
    23:03:21        WIN: 34GB       WSL: 1.0Gi
    23:03:23        WIN: 34GB       WSL: 1.0Gi
    23:03:24        WIN: 34GB       WSL: 1.0Gi
    23:03:25        WIN: 34GB       WSL: 1.0Gi
    23:03:27        WIN: 34GB       WSL: 1.0Gi
    23:03:28        WIN: 34GB       WSL: Catastrophic failure   Error code: Wsl/Service/E_UNEXPECTED
    23:03:29        WIN: 34GB       WSL: Catastrophic failure   Error code: Wsl/Service/E_UNEXPECTED
    23:03:31        WIN: 34GB       WSL: Catastrophic failure   Error code: Wsl/Service/E_UNEXPECTED
    23:03:32        WIN: 34GB       WSL: Catastrophic failure   Error code: Wsl/Service/E_UNEXPECTED
    23:03:33        WIN: 34GB       WSL: Catastrophic failure   Error code: Wsl/Service/E_UNEXPECTED
    PS C:\Users\tophy> wsl
    Catastrophic failure
    Error code: Wsl/Service/E_UNEXPECTED
    PS C:\Users\tophy>
    

    This is fairly serious: I can DoS the entire WSL system from a misbehaving userspace program.

    Recovery is running wsl --shutdown, and then waiting a sec and restarting. Seems to come back up fine, but the fact that I can break it from within the guest is a big problem.

  6. chemwolf6922 commented on May 8, 2026

    @chemwolf6922
    Contributor

    Hi Chris Sarbora (@tophyr) , I tried this but could not repro on my machine (the oom-killer correctly saved the system). Could you please share the dmesg while repro this? Thanks.
    kphillisjr's dmesg shows a absurdly high oom_score_adj for systemd. Making it the first target for oom-killer.

  7. tophyr commented on May 8, 2026

    @tophyr
    [   48.784409] hv_balloon: Max. dynamic memory size: 65096 MB
    [ 1020.783675] mini_init (357): drop_caches: 1
    [ 2894.919077] kworker/0:0: page allocation failure: order:7, mode:0xdc0(GFP_KERNEL|__GFP_ZERO), nodemask=(null),cpuset=/,mems_allowed=0
    [ 2894.919089] CPU: 0 PID: 10720 Comm: kworker/0:0 Not tainted 6.6.87.2-microsoft-standard-WSL2 #1
    [ 2894.919091] Workqueue: hv_pri_chan vmbus_add_channel_work
    [ 2894.919099] Call Trace:
    [ 2894.919101]  <TASK>
    [ 2894.919105]  dump_stack_lvl+0x4c/0x70
    [ 2894.919109]  dump_stack+0x14/0x20
    [ 2894.919111]  warn_alloc+0x10d/0x190
    [ 2894.919116]  ? __alloc_pages_direct_compact+0xa7/0x290
    [ 2894.919119]  __alloc_pages_slowpath.constprop.0+0xdb6/0xe80
    [ 2894.919122]  ? srso_alias_return_thunk+0x5/0xfbef5
    [ 2894.919125]  __alloc_pages+0x31c/0x350
    [ 2894.919128]  ? __pfx_hvs_channel_cb+0x10/0x10
    [ 2894.919131]  vmbus_alloc_ring+0x78/0xd0
    [ 2894.919133]  vmbus_open+0x2a/0x80
    [ 2894.919135]  hvs_probe+0x41d/0x4e0
    [ 2894.919139]  vmbus_probe+0x42/0xa0
    [ 2894.919141]  really_probe+0x1b5/0x420
    [ 2894.919145]  ? __pfx___device_attach_driver+0x10/0x10
    [ 2894.919146]  __driver_probe_device+0x7e/0x170
    [ 2894.919148]  driver_probe_device+0x23/0xa0
    [ 2894.919150]  __device_attach_driver+0x92/0x120
    [ 2894.919152]  bus_for_each_drv+0x8c/0xe0
    [ 2894.919155]  __device_attach+0xc1/0x1f0
    [ 2894.919157]  device_initial_probe+0x17/0x20
    [ 2894.919159]  bus_probe_device+0x9d/0xa0
    [ 2894.919161]  device_add+0x683/0x8a0
    [ 2894.919163]  ? srso_alias_return_thunk+0x5/0xfbef5
    [ 2894.919165]  ? hrtimer_init+0x2c/0x80
    [ 2894.919169]  device_register+0x1f/0x30
    [ 2894.919170]  vmbus_device_register+0x87/0x130
    [ 2894.919172]  vmbus_add_channel_work+0x146/0x1c0
    [ 2894.919174]  process_one_work+0x189/0x3c0
    [ 2894.919178]  ? __pfx_worker_thread+0x10/0x10
    [ 2894.919180]  worker_thread+0x1f6/0x390
    [ 2894.919182]  ? _raw_spin_unlock_irqrestore+0x2b/0x50
    [ 2894.919185]  ? __pfx_worker_thread+0x10/0x10
    [ 2894.919187]  kthread+0x109/0x140
    [ 2894.919189]  ? __pfx_kthread+0x10/0x10
    [ 2894.919191]  ret_from_fork+0x40/0x60
    [ 2894.919195]  ? __pfx_kthread+0x10/0x10
    [ 2894.919196]  ret_from_fork_asm+0x1b/0x30
    [ 2894.919201]  </TASK>
    [ 2894.919202] Mem-Info:
    [ 2894.919204] active_anon:1128 inactive_anon:10763241 isolated_anon:32
                    active_file:16789 inactive_file:16516 isolated_file:0
                    unevictable:0 dirty:6 writeback:0
                    slab_reclaimable:9851 slab_unreclaimable:27453
                    mapped:32931 shmem:931 pagetables:5342030
                    sec_pagetables:0 bounce:0
                    kernel_misc_reclaimable:0
                    free:91118 free_pcp:0 free_cma:0
    [ 2894.919207] Node 0 active_anon:4512kB inactive_anon:43052964kB active_file:67156kB inactive_file:66064kB unevictable:0kB isolated(anon):128kB isolated(file):0kB mapped:131724kB dirty:24kB writeback:0kB shmem:3724kB shmem_thp:0kB shmem_pmdmapped:0kB anon_thp:0kB writeback_tmp:0kB kernel_stack:7888kB pagetables:21368120kB sec_pagetables:0kB all_unreclaimable? no
    [ 2894.919210] Node 0 DMA32 free:242440kB boost:0kB min:2748kB low:6740kB high:10732kB reserved_highatomic:0KB active_anon:0kB inactive_anon:2496180kB active_file:0kB inactive_file:0kB unevictable:0kB writepending:0kB present:4061820kB managed:3995648kB mlocked:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
    [ 2894.919213] lowmem_reserve[]: 0 59956 59956 59956
    [ 2894.919216] Node 0 Normal free:122032kB boost:77824kB min:120128kB low:181520kB high:242912kB reserved_highatomic:0KB active_anon:4512kB inactive_anon:40556884kB active_file:67628kB inactive_file:66396kB unevictable:0kB writepending:0kB present:62595072kB managed:61403228kB mlocked:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
    [ 2894.919220] lowmem_reserve[]: 0 0 0 0
    [ 2894.919222] Node 0 DMA32: 2*4kB (M) 4*8kB (UE) 4*16kB (UE) 5*32kB (UE) 6*64kB (UME) 15*128kB (UM) 3*256kB (UM) 3*512kB (M) 2*1024kB (M) 3*2048kB (M) 56*4096kB (M) = 242440kB
    [ 2894.919236] Node 0 Normal: 100*4kB (UME) 1340*8kB (UME) 2080*16kB (UME) 1475*32kB (UME) 412*64kB (UME) 30*128kB (UME) 1*256kB (M) 0*512kB 0*1024kB 0*2048kB 0*4096kB = 122064kB
    [ 2894.919247] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB
    [ 2894.919249] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
    [ 2894.919250] 34426 total pagecache pages
    [ 2894.919251] 41 pages in swap cache
    [ 2894.919252] Free swap  = 16776180kB
    [ 2894.919252] Total swap = 16777216kB
    [ 2894.919253] 16664223 pages RAM
    [ 2894.919253] 0 pages HighMem/MovableOnly
    [ 2894.919254] 314504 pages reserved
    [ 2894.919255] 0 pages hwpoisoned
    [ 2916.400363] crash invoked oom-killer: gfp_mask=0x140dca(GFP_HIGHUSER_MOVABLE|__GFP_COMP|__GFP_ZERO), order=0, oom_score_adj=0
    [ 2916.400370] CPU: 7 PID: 11005 Comm: crash Not tainted 6.6.87.2-microsoft-standard-WSL2 #1
    [ 2916.400373] Call Trace:
    [ 2916.400375]  <TASK>
    [ 2916.400378]  dump_stack_lvl+0x4c/0x70
    [ 2916.400383]  dump_stack+0x14/0x20
    [ 2916.400384]  dump_header+0x51/0x260
    [ 2916.400388]  oom_kill_process+0x100/0x1a0
    [ 2916.400390]  out_of_memory+0x11d/0x560
    [ 2916.400392]  __alloc_pages_slowpath.constprop.0+0x88d/0xe80
    [ 2916.400398]  __alloc_pages+0x31c/0x350
    [ 2916.400401]  __folio_alloc+0x1a/0x40
    [ 2916.400403]  vma_alloc_folio+0xad/0x390
    [ 2916.400405]  ? srso_alias_return_thunk+0x5/0xfbef5
    [ 2916.400408]  do_anonymous_page+0x79/0x420
    [ 2916.400411]  __handle_mm_fault+0x818/0x840
    [ 2916.400416]  handle_mm_fault+0xc7/0x2f0
    [ 2916.400418]  do_user_addr_fault+0x188/0x660
    [ 2916.400421]  exc_page_fault+0x73/0x160
    [ 2916.400424]  asm_exc_page_fault+0x2b/0x30
    [ 2916.400426] RIP: 0033:0x7f08ec6ac76d
    [ 2916.400431] Code: Unable to access opcode bytes at 0x7f08ec6ac743.
    [ 2916.400433] RSP: 002b:00007ffee38467c0 EFLAGS: 00010206
    [ 2916.400434] RAX: 00006fe163209fc0 RBX: 0000000000100010 RCX: 0000000000100011
    [ 2916.400435] RDX: 0000000000020031 RSI: 00006fe163309fd0 RDI: 00006fe16332a001
    [ 2916.400436] RBP: 00007ffee3846840 R08: 0000000000000000 R09: 0000000000000000
    [ 2916.400437] R10: 0000000000000001 R11: 00006fe16322a000 R12: 00007f08ec803ac0
    [ 2916.400438] R13: 0000000000100000 R14: 00006fe163209fd0 R15: 00007f08ec803ac0
    [ 2916.400442]  </TASK>
    [ 2916.400443] Mem-Info:
    [ 2916.400445] active_anon:106529 inactive_anon:9259293 isolated_anon:32
                    active_file:70 inactive_file:73 isolated_file:0
                    unevictable:0 dirty:0 writeback:356
                    slab_reclaimable:7352 slab_unreclaimable:27651
                    mapped:786 shmem:663 pagetables:6723370
                    sec_pagetables:0 bounce:0
                    kernel_misc_reclaimable:0
                    free:145376 free_pcp:0 free_cma:0
    [ 2916.400448] Node 0 active_anon:426116kB inactive_anon:37037172kB active_file:280kB inactive_file:292kB unevictable:0kB isolated(anon):128kB isolated(file):0kB mapped:3144kB dirty:0kB writeback:1424kB shmem:2652kB shmem_thp:0kB shmem_pmdmapped:0kB anon_thp:0kB writeback_tmp:0kB kernel_stack:7808kB pagetables:26893480kB sec_pagetables:0kB all_unreclaimable? no
    [ 2916.400451] Node 0 DMA32 free:242572kB boost:0kB min:2748kB low:6740kB high:10732kB reserved_highatomic:0KB active_anon:0kB inactive_anon:2497524kB active_file:0kB inactive_file:0kB unevictable:0kB writepending:0kB present:4061820kB managed:3995648kB mlocked:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
    [ 2916.400454] lowmem_reserve[]: 0 59956 59956 59956
    [ 2916.400457] Node 0 Normal free:338932kB boost:247632kB min:289936kB low:351328kB high:412720kB reserved_highatomic:49152KB active_anon:426328kB inactive_anon:34538924kB active_file:512kB inactive_file:0kB unevictable:0kB writepending:1028kB present:62595072kB managed:61403228kB mlocked:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB
    [ 2916.400460] lowmem_reserve[]: 0 0 0 0
    [ 2916.400463] Node 0 DMA32: 1*4kB (M) 5*8kB (UME) 4*16kB (UE) 5*32kB (UE) 4*64kB (E) 11*128kB (UM) 2*256kB (UM) 3*512kB (UM) 1*1024kB (M) 4*2048kB (M) 56*4096kB (M) = 242572kB
    [ 2916.400477] Node 0 Normal: 49*4kB (ME) 32*8kB (ME) 24*16kB (ME) 21*32kB (UME) 8*64kB (ME) 2235*128kB (UM) 198*256kB (UM) 0*512kB 0*1024kB 0*2048kB 0*4096kB = 338788kB
    [ 2916.400488] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB
    [ 2916.400489] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
    [ 2916.400490] 39342 total pagecache pages
    [ 2916.400491] 38463 pages in swap cache
    [ 2916.400491] Free swap  = 0kB
    [ 2916.400492] Total swap = 16777216kB
    [ 2916.400493] 16664223 pages RAM
    [ 2916.400493] 0 pages HighMem/MovableOnly
    [ 2916.400494] 314504 pages reserved
    [ 2916.400494] 0 pages hwpoisoned
    [ 2916.400495] Tasks state (memory values in pages):
    [ 2916.400496] [  pid  ]   uid  tgid total_vm      rss pgtables_bytes swapents oom_score_adj name
    [ 2916.400500] [    359]     0   359     1396      128    53248        0             0 agetty
    [ 2916.400502] [    366]   999   366     1073      128    53248        0             0 chronyd
    [ 2916.400504] [    375]     0   375      804      576    45056        0             0 GnsEngine
    [ 2916.400506] [    378]     0   378      766      448    45056        0             0 init
    [ 2916.400507] [    380]     0   380      730      448    45056        0             0 init
    [ 2916.400509] [    381]     0   381      765      512    45056        0             0 init()
    [ 2916.400510] [    386]     0   386     5369      764    86016       64             0 systemd
    [ 2916.400512] [    389]     0   389      765      384    45056        0             0 init-systemd(Ub
    [ 2916.400513] [    395]     0   395    30551      512    94208        0             0 WSLGd
    [ 2916.400515] [    399]  1000   399   243360     3216   385024        0             0 weston
    [ 2916.400516] [    422]     0   422      773      448    49152        0             0 init
    [ 2916.400518] [    424]  1000   424      732      448    49152        0             0 init
    [ 2916.400519] [    425]  1000   425     2404      256    65536        0             0 dbus-daemon
    [ 2916.400521] [    426]  1000   426    58834      448    94208        0             0 pulseaudio
    [ 2916.400523] [    434]  1000   434     2371      256    65536        0             0 dbus-daemon
    [ 2916.400524] [    437]  1000   437    88899     2790   348160      704             0 Xwayland
    [ 2916.400526] [    469]     0   469    12611      451    94208        0          -250 systemd-journal
    [ 2916.400528] [    534]     0   534     6317      576    73728        0         -1000 systemd-udevd
    [ 2916.400529] [    549]     0   549    38267      128    69632        0             0 snapfuse
    [ 2916.400531] [    551]     0   551   131689     2778   135168        0             0 snapfuse
    [ 2916.400532] [    552]     0   552    38234      128    65536        0             0 snapfuse
    [ 2916.400534] [    581]   991   581     5365      896    86016        0             0 systemd-resolve
    [ 2916.400535] [    582]   996   582    22757      448    77824        0             0 systemd-timesyn
    [ 2916.400537] [    663]     0   663     1059      192    49152        0             0 cron
    [ 2916.400539] [    664]   101   664     2407      256    65536        0          -900 dbus-daemon
    [ 2916.400540] [    671]     0   671   647311     3833   356352      576          -900 snapd
    [ 2916.400542] [    673]     0   673     4491      512    77824        0             0 systemd-logind
    [ 2916.400544] [    680]     0   680      790      128    53248        0             0 agetty
    [ 2916.400545] [    698]   102   698    55627      384    86016        0             0 rsyslogd
    [ 2916.400546] [    700]     0   700      779      128    45056        0             0 agetty
    [ 2916.400548] [    711]     0   711    26753     2560   106496       64             0 unattended-upgr
    [ 2916.400550] [    877]     0   877      769      192    45056        0             0 SessionLeader
    [ 2916.400551] [    878]     0   878      769      192    45056        0             0 Relay(366)
    [ 2916.400553] [    879]  1000   879     1550      256    57344      384             0 bash
    [ 2916.400554] [    880]     0   880     1705      384    57344        0             0 login
    [ 2916.400556] [    936]  1000   936     5088      768    81920        0           100 systemd
    [ 2916.400557] [    937]  1000   937     5288      623    73728        0           100 (sd-pam)
    [ 2916.400559] [    948]  1000   948     1518      576    57344        0             0 bash
    [ 2916.400560] [   1018]  1000  1018 18504817     6834  1785856    71296             0 claude
    [ 2916.400562] [   1791]     0  1791      767      192    45056        0             0 SessionLeader
    [ 2916.400563] [   1792]     0  1792      771      192    45056        0             0 Relay(1269)
    [ 2916.400565] [   1793]  1000  1793      700       64    45056        0             0 sh
    [ 2916.400566] [   1794]  1000  1794      700      128    45056        0             0 sh
    [ 2916.400568] [   1804]  1000  1804   253797      728   598016     1792             0 node
    [ 2916.400570] [   1829]  1000  1829      700      128    45056        0             0 sh
    [ 2916.400572] [  10811]     0 10811      769      192    45056        0             0 SessionLeader
    [ 2916.400573] [  10812]     0 10812      769      192    45056        0             0 Relay(10263)
    [ 2916.400575] [  10813]  1000 10813     1550      192    53248      384             0 bash
    [ 2916.400577] [  10998]     0 10998      769      192    45056        0             0 SessionLeader
    [ 2916.400578] [  10999]     0 10999      769      192    45056        0             0 Relay(10454)
    [ 2916.400579] [  11005]  1000 11005 3434979929  9302272 27533660160  4115200             0 crash
    [ 2916.400581] [  11236]     0 11236      765      192    45056        0             0 SessionLeader
    [ 2916.400582] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/init.scope,task=crash,pid=11005,uid=1000
    [ 2916.400594] Out of memory: Killed process 11005 (crash) total-vm:13739919716kB, anon-rss:37208576kB, file-rss:512kB, shmem-rss:0kB, UID:1000 pgtables:26888340kB oom_score_adj:0
    [ 2918.376109] systemd-journald[40]: Under memory pressure, flushing caches.
    [ 2922.897605] oom_reaper: reaped process 11005 (crash), now anon-rss:3500kB, file-rss:512kB, shmem-rss:0kB
    [ 2923.884222] WSL (10685 - SessionLeader) ERROR: UtilAcceptVsock:271: accept4 failed 110
    [ 2923.884674] WSL (10685 - SessionLeader) ERROR: operator():1325: UtilAcceptVsock() failed for session leader 110
    tophy@thor:/mnt/c/Users/tophy$
    

    oomkiller does save the Linux system... what's weird is that WSL itself dies about two minutes later. Note in my trace above that at 23:01:37 the wsl -e command blocked for 32 seconds, before the loop resumed at 23:02:09 showing a nearly-empty Linux RAM usage.

    I haven't been able to find any Event Viewer logs that indicate what's happening to WSL in the intervening 81 seconds that ends up in "Catastrophic failure" state. I'd be happy to collect more info for you.

  8. kphillisjr commented on May 8, 2026

    @kphillisjr
    Author

    I am actually able to reliably produce the crash on two different computers. I believe that the process VmmemWSL is what is crashing on my system. The only reason I believe this is that this process maxes out my Disk I/O before the WSL instance crashes when I watch the system with task manager running.

    Additional System Information

    System 1:

    • Windows 11 Pro
    • Visual Studio 2022 Community Edition
    • Ryzen 7 5800X
    • ASRock X570 Taichi motherboard
    • 64GB Ram

    System 2:

    • Windows 11 Home
    • Visual Studio 2022 Professional Edition
    • Lenovo Ideapad 83DS0000US
    • AMD Ryzen™ 7 8845HS
    • 16GB Ram

    Configuration System 1

    Crashes occur regulary when the file %userprofile%\.wslconfig is configured for 2GB of Memory. I am able to stop the crashing by updating the file contents to:

    [wsl2]
    memory=16GB
    

    From:

    [wsl2]
    memory=2GB
    

    Configuration System 2

    This system lacks the configuration file in system 1.

  9. chemwolf6922 commented on May 8, 2026

    @chemwolf6922
    Contributor

    Hi Kenney Phillis Jr. (@kphillisjr) , the crash is caused by the OOM. 2G ram is not near enough for your use case (at least at the default ninja build parallelism). OOM on Linux will cause connection failures like this. In your case, the wsl core port closed due to a failure to allocate a ring buffer in the kernel.
    The VmmemWSL is just a view port on Windows to show the overall wsl VM resource usage. It does not actually do anything.

    The interesting thing here is why does WSL stuck at that "Catastrophic Failure" state. I'll trying to look in to that.

  10. chemwolf6922 commented on May 8, 2026

    @chemwolf6922
    Contributor
  11. tophyr commented on May 8, 2026

    @tophyr

    Feng Wang (@chemwolf6922) I'll open a new issue; it sounds like my case is different than Kenney Phillis Jr. (@kphillisjr)'s.

  12. chemwolf6922 commented on May 8, 2026

    @chemwolf6922
    Contributor

    Kenney Phillis Jr. (@kphillisjr) , The stuck at Catastrophic Failure issue could have been fixed in this PR: #14455. Could you please try out the 2.7.3 pre-release version https://github.com/microsoft/WSL/releases/tag/2.7.3 with the same settings (memory limited to 2GB) to see if wsl still stuck after the compilation failure? Thanks.
    I'm also experimenting with reserving memory for critical wsl processes to avoid them break under heavy memory load: https://github.com/microsoft/WSL/tree/user/chemwolf6922/protect-wsl-core-processes-with-memory-cgroup. I'll update here if that goes anywhere.

  13. kphillisjr commented on May 8, 2026

    @kphillisjr
    Author

    I am able to get wsl to crash with 8GB available on WSL 2.7.3 with the same script and a few more packages installed... namely...

    apt-get install build-essential git make \
    pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \
    libaudio-dev libfribidi-dev libjack-dev libsndio-dev libx11-dev libxext-dev \
    libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libxtst-dev \
    libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
    libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev libthai-dev
    
    apt-get install libpipewire-0.3-dev libwayland-dev libdecor-0-dev liburing-dev 
    
    apt-get install libusb-1.0-0-dev libusb-dev 
    

    WslLogs-2026-05-08_13-21-11.tar.gz

    NOTE: This is when attempting to build the release build from a clean development tree meaning that I perform the following steps after the packages are installed...

    1. Open a command line and start wsl.
    2. erase the old development files.
    rm -rf ~/.vs/VkSDKBuilder/out/build/
    
    1. Open the project in visual studio.
    2. Have Visual Studio recreate the cmake files by using the menu optionProject and then delete cache and reconfigure.
    3. under wsl, navigate to the new build folder mentioned in visual studio.
    4. build the project again using ninja.
  14. github-actions commented on May 8, 2026

    @github-actions
    Contributor
    Diagnostic information
    .wslconfig found
    Detected appx version: 2.7.3.0
    Detected user visible error: Wsl/Service/E_UNEXPECTED
    
  15. chemwolf6922 commented on May 9, 2026

    @chemwolf6922
    Contributor

    Hi Kenney Phillis Jr. (@kphillisjr) , I created a build with the memory reservation change: https://github.com/chemwolf6922/build-wsl/actions/runs/25588991182/artifacts/6892119985. It's based on this commit: da600f6.

    If possible, could you please try out this build to see if wsl still errors out after the build fails? Thanks. If you see timeout errors instead of catastrophic failure, please wait for several minutes for the compiler processes to die out. And see if wsl is eventually recovered.

    Please note this is not a stable build. Thus it may contain other bugs. It's recommended to change back to a release / pre-release version after the test.

  16. kphillisjr commented on May 12, 2026

    @kphillisjr
    Author

    The build for commit da600f6 did not have the whole wsl subsystem crash on my system. I am including the log for the build below...

    WslLogs-2026-05-12_14-23-24.tar.gz

  17. github-actions commented on May 12, 2026

    @github-actions
    Contributor
    Diagnostic information
    .wslconfig found
    Appx package is not installed
    Detected user visible error: Wsl/Service/WSAETIMEDOUT
    
  18. falghamdi125 commented on Jun 5, 2026

    @falghamdi125

    Since your second system only has 2 GB of RAM for WSL, you can help prevent out of memory errors by allocating more swap space for WSL.

    %UserProfile%\.wslconfig :

    [wsl2]
    memory=2GB
    swap=16GB

    Windows by default allocates swap as 25% of your WSL memory. So in you case, it's only 512gb which is insufficient. Remember large swap files can help prevent WSL from running out of memory. However, if WSL relies heavily on swap, performance may slow down because disk I/O is expensive. it can also increase disk wear over time.

  19. edsonms-sato commented on Aug 6, 2026

    @edsonms-sato

    I fixed on my side by using the following settings.json with this wsl configuration (I have 32GB RAM):
    [wsl2]
    memory=16GB ( only if you have 32gb of RAM. If you have more RAM, increase this)
    swap=8GB
    localhostForwarding=true

    And then I figured out VSCode indexing was consuming a lot of memory which I managed to fix with this settings.json:
    {
    "chat.disableAIFeatures": true,
    "dev.containers.dockerPath": "podman",
    "dev.containers.mountWaylandSocket": false
    "search.exclude": {
    "/node_modules": true,
    "
    /bower_components": true,
    "/*.code-search": true,
    "
    /.git": true,
    "/dist": true,
    "
    /build": true
    },
    "files.watcherExclude": {
    "/node_modules/": true,
    "/dist/": true,
    "/build/": true,
    "/.git/objects/": true,
    "/.git/subtree-cache/": true,
    "/.hg/store/": true
    },

    }

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

    needs-investigationlikely actionable and/or needs more investigationwsl2Issue/feature applies to WSL 2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions