microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.32k stars 814 forks source link

Starting WSL Preview from the command line fails with `{Application Error} The application was unable to start correctly (0xlx).` #7626

Open MatthewL246 opened 2 years ago

MatthewL246 commented 2 years ago

Version

Microsoft Windows [Version 10.0.22000.282]

WSL Version

Kernel Version

Default Distribution: Ubuntu Default Version: 2 WSL version: 0.48.2.0 Kernel version: 5.10.60.1 WSLg version: 1.0.29 Windows version: 10.0.22000.282

Distro Version

Ubuntu 21.10 (updated from Store release)

Other Software

N/A, just Windows Terminal

Repro Steps

  1. Install WSL Preview from the Microsoft Store
  2. Run wsl.exe --shutdown
  3. Run wsl.exe. Observe as it freezes for a second and then fails.
  4. Run ubuntu.exe or click Ubuntu in the Start menu. Observe as it also fails.
  5. Run wsl.exe --status or wsl.exe --help. These commands succeed.
  6. From the Start menu or the Microsoft Store, open "Windows Subsystem for Linux Preview" and observe that WSL starts.
  7. Now, WSL will start regardless of which method you use.
  8. After running wsl --shutdown, notice that the problem reappears.

Note: Uninstalling WSL Preview from the store and using the version of WSL 2 included in Windows prevents this problem.

Expected Behavior

WSL should always start successfully from both the command line and the Start menu.

Actual Behavior

WSL fails to start from the command line. When using Windows Terminal, it shows the error message of:

{Application Error}
The application was unable to start correctly (0xlx). Click OK to close the application.

[process exited with code 3221226505 (0xc0000409)]

Note: Powershell thinks the error level is -1073740791.

However, WSL does start when clicking "Windows Susbsystem for Linux Preview" from the Start menu but not when clicking "Ubuntu".

Diagnostic Logs

See diagnostic details ### My command history: ``` Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows PS C:\Users\Matthew> wsl --shutdown PS C:\Users\Matthew> wsl --help Copyright (c) Microsoft Corporation. All rights reserved. For privacy information about this product please visit https://aka.ms/privacy. Usage: wsl.exe [Argument] [Options...] [CommandLine] # Lengthy command output snipped PS C:\Users\Matthew> wsl --status Default Distribution: Ubuntu Default Version: 2 WSL version: 0.48.2.0 Kernel version: 5.10.60.1 WSLg version: 1.0.29 Windows version: 10.0.22000.282 PS C:\Users\Matthew> wsl {Application Error} The application was unable to start correctly (0xlx). Click OK to close the application. PS C:\Users\Matthew> wsl {Application Error} The application was unable to start correctly (0xlx). Click OK to close the application. PS C:\Users\Matthew> echo $LASTEXITCODE -1073740791 PS C:\Users\Matthew> ubuntu --help Launches or configures a Linux distribution. Usage: Launches the user's default shell in the user's home directory. install [--root] Install the distribuiton and do not launch the shell when complete. --root Do not create a user account and leave the default user set to root. run Run the provided command line in the current working directory. If no command line is provided, the default shell is launched. config [setting [value]] Configure settings for this distribution. Settings: --default-user Sets the default user to . This must be an existing user. help Print usage information. PS C:\Users\Matthew> ubuntu {Application Error} The application was unable to start correctly (0xlx). Click OK to close the application. PS C:\Users\Matthew> # This is where I started WSL Preview from the Start menu PS C:\Users\Matthew> wsl (process:283): dconf-WARNING **: 14:15:40.720: failed to commit changes to dconf: Could not connect: Connection refused root@Matthew-Laptop:/mnt/c/Users/Matthew# cd root@Matthew-Laptop:~# lsb_release -a LSB Version: core-11.1.0ubuntu3-noarch:printing-11.1.0ubuntu3-noarch:security-11.1.0ubuntu3-noarch Distributor ID: Ubuntu Description: Ubuntu 21.10 Release: 21.10 Codename: impish root@Matthew-Laptop:~# uname -a Linux Matthew-Laptop 5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux root@Matthew-Laptop:~# exit logout PS C:\Users\Matthew> wsl --shutdown PS C:\Users\Matthew> ubuntu {Application Error} The application was unable to start correctly (0xlx). Click OK to close the application. PS C:\Users\Matthew> echo $LASTEXITCODE -1073740791 PS C:\Users\Matthew> ^C ``` ### WinDbg Output: ``` Microsoft (R) Windows Debugger Version 10.0.22415.1003 AMD64 Copyright (c) Microsoft Corporation. All rights reserved. CommandLine: C:\Windows\System32\wsl.exe ************* Path validation summary ************** Response Time (ms) Location Deferred srv* Symbol search path is: srv* Executable search path is: ModLoad: 00007ff7`69ee0000 00007ff7`69f0b000 wsl.exe ModLoad: 00007ffb`85740000 00007ffb`85947000 ntdll.dll ModLoad: 00007ffb`846e0000 00007ffb`8479d000 C:\WINDOWS\System32\KERNEL32.DLL ModLoad: 00007ffb`82bf0000 00007ffb`82f64000 C:\WINDOWS\System32\KERNELBASE.dll ************* Path validation summary ************** Response Time (ms) Location Deferred srv* Symbol search path is: srv* Executable search path is: ModLoad: 00007ff6`e7170000 00007ff6`e726e000 conhost.exe ModLoad: 00007ffb`85740000 00007ffb`85947000 ntdll.dll ModLoad: 00007ffb`846e0000 00007ffb`8479d000 C:\WINDOWS\System32\KERNEL32.DLL ModLoad: 00007ffb`82bf0000 00007ffb`82f64000 C:\WINDOWS\System32\KERNELBASE.dll ModLoad: 00007ffb`83390000 00007ffb`8342d000 C:\WINDOWS\System32\msvcp_win.dll ModLoad: 00007ffb`83180000 00007ffb`83291000 C:\WINDOWS\System32\ucrtbase.dll (5d18.2734): Break instruction exception - code 80000003 (first chance) ntdll!LdrpDoDebuggerBreak+0x30: 00007ffb`8581ca64 cc int 3 1:001> g ModLoad: 00007ffb`84930000 00007ffb`84a1a000 C:\WINDOWS\System32\shcore.dll ModLoad: 00007ffb`83e90000 00007ffb`83f3c000 C:\WINDOWS\System32\advapi32.dll ModLoad: 00007ffb`83de0000 00007ffb`83e83000 C:\WINDOWS\System32\msvcrt.dll ModLoad: 00007ffb`84d70000 00007ffb`84e0d000 C:\WINDOWS\System32\sechost.dll ModLoad: 00007ffb`847a0000 00007ffb`848c1000 C:\WINDOWS\System32\RPCRT4.dll ModLoad: 00007ffb`84340000 00007ffb`846b8000 C:\WINDOWS\System32\combase.dll ModLoad: 00007ffb`84bc0000 00007ffb`84d6c000 C:\WINDOWS\System32\user32.dll ModLoad: 00007ffb`83360000 00007ffb`83386000 C:\WINDOWS\System32\win32u.dll ModLoad: 00007ffb`84f80000 00007ffb`84fa9000 C:\WINDOWS\System32\GDI32.dll ModLoad: 00007ffb`83060000 00007ffb`83172000 C:\WINDOWS\System32\gdi32full.dll ModLoad: 00007ffb`841f0000 00007ffb`84221000 C:\WINDOWS\System32\IMM32.DLL ModLoad: 00007ffb`81d40000 00007ffb`81d58000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll ModLoad: 00007ffb`82f70000 00007ffb`82ff0000 C:\WINDOWS\System32\bcryptPrimitives.dll ModLoad: 00007ffb`84fb0000 00007ffb`8505f000 C:\WINDOWS\System32\clbcatq.dll ModLoad: 00007ffb`77d80000 00007ffb`77d9b000 C:\WINDOWS\SYSTEM32\windows.staterepositorycore.dll onecore\com\combase\registrationstore\registrationstore.cpp(7933)\combase.dll!00007FFB843ED8E4: (caller: 00007FFB8434D9C5) ReturnHr(1) tid(54c0) 80070002 The system cannot find the file specified. onecore\com\combase\registrationstore\registrationstore.cpp(7933)\combase.dll!00007FFB843ED8E4: (caller: 00007FFB8434D9C5) ReturnHr(2) tid(54c0) 80070002 The system cannot find the file specified. onecore\com\combase\registrationstore\registrationstore.cpp(7933)\combase.dll!00007FFB843ED8E4: (caller: 00007FFB8434D9C5) ReturnHr(3) tid(54c0) 80070002 The system cannot find the file specified. ModLoad: 00007ffb`6e710000 00007ffb`6e719000 C:\ProgramData\Microsoft\Windows\AppRepository\Packages\Microsoft.WindowsTerminal_1.11.2921.0_x64__8wekyb3d8bbwe\PackagedCom\OpenConsoleProxy.dll ModLoad: 00007ffb`53480000 00007ffb`5349b000 C:\WINDOWS\SYSTEM32\VCRUNTIME140.dll ModLoad: 00007ffb`7cb60000 00007ffb`7cbf1000 C:\WINDOWS\SYSTEM32\apphelp.dll onecore\windows\core\console\open\src\interactivity\base\hostsignalinputthread.cpp(99)\conhost.exe!00007FF6E7208D69: (caller: 00007FFB846F54E0) LogNt(1) tid(6034) C0000008 An invalid HANDLE was specified. onecore\windows\core\console\open\src\interactivity\base\hostsignalinputthread.cpp(99)\conhost.exe!00007FF6E7208D69: (caller: 00007FFB846F54E0) LogNt(2) tid(6034) C0000008 An invalid HANDLE was specified. ModLoad: 00007ffb`83180000 00007ffb`83291000 C:\WINDOWS\System32\ucrtbase.dll ModLoad: 00007ffb`84930000 00007ffb`84a1a000 C:\WINDOWS\System32\shcore.dll ModLoad: 00007ffb`83390000 00007ffb`8342d000 C:\WINDOWS\System32\msvcp_win.dll ModLoad: 00007ffb`84340000 00007ffb`846b8000 C:\WINDOWS\System32\combase.dll ModLoad: 00007ffb`847a0000 00007ffb`848c1000 C:\WINDOWS\System32\RPCRT4.dll ModLoad: 00007ffb`84ea0000 00007ffb`84f76000 C:\WINDOWS\System32\OLEAUT32.dll (466c.6238): Break instruction exception - code 80000003 (first chance) ntdll!LdrpDoDebuggerBreak+0x30: 00007ffb`8581ca64 cc int 3 0:000> g ModLoad: 00007ffb`81d40000 00007ffb`81d58000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll ModLoad: 00007ffb`83de0000 00007ffb`83e83000 C:\WINDOWS\System32\msvcrt.dll ModLoad: 00007ffb`82f70000 00007ffb`82ff0000 C:\WINDOWS\System32\bcryptPrimitives.dll ModLoad: 00007ffb`84d70000 00007ffb`84e0d000 C:\WINDOWS\System32\sechost.dll ModLoad: 00007ffb`84fb0000 00007ffb`8505f000 C:\WINDOWS\System32\clbcatq.dll ModLoad: 00007ffb`4afb0000 00007ffb`4afec000 C:\Windows\System32\AppExtension.dll ModLoad: 00007ffb`4e880000 00007ffb`4e9b4000 C:\Windows\System32\Windows.StateRepositoryPS.dll ModLoad: 00007ffb`84bc0000 00007ffb`84d6c000 C:\WINDOWS\System32\user32.dll ModLoad: 00007ffb`83360000 00007ffb`83386000 C:\WINDOWS\System32\win32u.dll ModLoad: 00007ffb`84f80000 00007ffb`84fa9000 C:\WINDOWS\System32\GDI32.dll ModLoad: 00007ffb`83060000 00007ffb`83172000 C:\WINDOWS\System32\gdi32full.dll ModLoad: 00007ffb`841f0000 00007ffb`84221000 C:\WINDOWS\System32\IMM32.DLL ModLoad: 00007ffb`532d0000 00007ffb`533c0000 C:\Windows\System32\Windows.ApplicationModel.dll ModLoad: 00007ffb`80bb0000 00007ffb`80d16000 C:\WINDOWS\SYSTEM32\wintypes.dll ModLoad: 00007ffb`68530000 00007ffb`6856e000 C:\WINDOWS\SYSTEM32\windows.staterepositoryclient.dll ModLoad: 00007ffb`80d20000 00007ffb`81582000 C:\WINDOWS\SYSTEM32\windows.storage.dll ModLoad: 00007ffb`84a20000 00007ffb`84bba000 C:\WINDOWS\System32\ole32.dll ModLoad: 00007ffb`85670000 00007ffb`856cd000 C:\WINDOWS\System32\shlwapi.dll ModLoad: 00007ffb`828f0000 00007ffb`8293c000 C:\WINDOWS\SYSTEM32\CFGMGR32.dll ModLoad: 00007ffb`80880000 00007ffb`80977000 C:\WINDOWS\system32\propsys.dll ModLoad: 00007ffb`82b20000 00007ffb`82b41000 C:\WINDOWS\SYSTEM32\profapi.dll ModLoad: 00007ffb`835a0000 00007ffb`83d4a000 C:\WINDOWS\System32\shell32.dll ModLoad: 00007ffb`5a020000 00007ffb`5a038000 C:\WINDOWS\system32\NetworkExplorer.dll ModLoad: 00007ffb`835a0000 00007ffb`83d4a000 C:\WINDOWS\System32\SHELL32.dll ModLoad: 00007ffb`49890000 00007ffb`49905000 C:\Windows\System32\Windows.FileExplorer.Common.dll ModLoad: 00007ffb`7a7d0000 00007ffb`7aa82000 C:\Windows\System32\iertutil.dll ModLoad: 00007ffb`83e90000 00007ffb`83f3c000 C:\WINDOWS\System32\advapi32.dll onecore\com\combase\objact\objact.cxx(4080)\combase.dll!00007FFB843A5105: (caller: 00007FFB843A1B12) ReturnHr(1) tid(6238) 80040154 Class not registered ModLoad: 00007ffb`678f0000 00007ffb`6791b000 C:\WINDOWS\system32\mssprxy.dll ModLoad: 00007ffb`7cd00000 00007ffb`7cdac000 C:\WINDOWS\system32\uxtheme.dll ModLoad: 00007ffb`39b10000 00007ffb`39b32000 C:\Program Files\MenuTools\MenuToolsHook64.dll ************* Path validation summary ************** Response Time (ms) Location Deferred srv* Symbol search path is: srv* Executable search path is: ModLoad: 00007ff7`3d220000 00007ff7`3d2ad000 wsl.exe ModLoad: 00007ffb`85740000 00007ffb`85947000 ntdll.dll ModLoad: 00007ffb`846e0000 00007ffb`8479d000 C:\WINDOWS\System32\KERNEL32.DLL ModLoad: 00007ffb`82bf0000 00007ffb`82f64000 C:\WINDOWS\System32\KERNELBASE.dll onecore\windows\core\console\open\src\interactivity\base\hostsignalinputthread.cpp(99)\conhost.exe!00007FF6E7208D69: (caller: 00007FFB846F54E0) LogNt(3) tid(6034) C0000008 An invalid HANDLE was specified. onecore\windows\core\console\open\src\interactivity\base\hostsignalinputthread.cpp(99)\conhost.exe!00007FF6E7208D69: (caller: 00007FFB846F54E0) LogNt(4) tid(6034) C0000008 An invalid HANDLE was specified. onecore\windows\core\console\open\src\interactivity\base\hostsignalinputthread.cpp(99)\conhost.exe!00007FF6E7208D69: (caller: 00007FFB846F54E0) LogNt(5) tid(6034) C0000008 An invalid HANDLE was specified. ModLoad: 00007ffb`854e0000 00007ffb`8554f000 C:\WINDOWS\System32\WS2_32.dll ModLoad: 00007ffb`847a0000 00007ffb`848c1000 C:\WINDOWS\System32\RPCRT4.dll ModLoad: 00007ffb`85670000 00007ffb`856cd000 C:\WINDOWS\System32\SHLWAPI.dll ModLoad: 00007ffb`83de0000 00007ffb`83e83000 C:\WINDOWS\System32\msvcrt.dll ModLoad: 00007ffb`84bc0000 00007ffb`84d6c000 C:\WINDOWS\System32\USER32.dll ModLoad: 00007ffb`83360000 00007ffb`83386000 C:\WINDOWS\System32\win32u.dll ModLoad: 00007ffb`84f80000 00007ffb`84fa9000 C:\WINDOWS\System32\GDI32.dll ModLoad: 00007ffb`83060000 00007ffb`83172000 C:\WINDOWS\System32\gdi32full.dll ModLoad: 00007ffb`83390000 00007ffb`8342d000 C:\WINDOWS\System32\msvcp_win.dll ModLoad: 00007ffb`83180000 00007ffb`83291000 C:\WINDOWS\System32\ucrtbase.dll ModLoad: 00007ffb`835a0000 00007ffb`83d4a000 C:\WINDOWS\System32\SHELL32.dll ModLoad: 00007ffb`84a20000 00007ffb`84bba000 C:\WINDOWS\System32\ole32.dll ModLoad: 00007ffb`84340000 00007ffb`846b8000 C:\WINDOWS\System32\combase.dll ModLoad: 00007ffb`83e90000 00007ffb`83f3c000 C:\WINDOWS\System32\ADVAPI32.dll ModLoad: 00007ffb`84d70000 00007ffb`84e0d000 C:\WINDOWS\System32\sechost.dll ModLoad: 00007ffb`84ea0000 00007ffb`84f76000 C:\WINDOWS\System32\OLEAUT32.dll ModLoad: 00007ffb`342e0000 00007ffb`3436d000 C:\WINDOWS\SYSTEM32\MSVCP140.dll ModLoad: 00007ffb`53480000 00007ffb`5349b000 C:\WINDOWS\SYSTEM32\VCRUNTIME140.dll ModLoad: 00007ffb`67d40000 00007ffb`67d4c000 C:\WINDOWS\SYSTEM32\VCRUNTIME140_1.dll ModLoad: 00007ffb`82290000 00007ffb`822b9000 C:\WINDOWS\SYSTEM32\USERENV.dll ModLoad: 00007ffb`821d0000 00007ffb`82237000 C:\WINDOWS\SYSTEM32\MSWSOCK.dll ModLoad: 00007ffb`6e120000 00007ffb`6e130000 C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemforLinux_0.48.2.0_x64__8wekyb3d8bbwe\WslDeps.dll (637c.4134): Break instruction exception - code 80000003 (first chance) ntdll!LdrpDoDebuggerBreak+0x30: 00007ffb`8581ca64 cc int 3 2:017> g ModLoad: 00007ffb`841f0000 00007ffb`84221000 C:\WINDOWS\System32\IMM32.DLL ModLoad: 00007ffb`81d40000 00007ffb`81d58000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll ModLoad: 00007ffb`82f70000 00007ffb`82ff0000 C:\WINDOWS\System32\bcryptPrimitives.dll ModLoad: 00007ffb`84fb0000 00007ffb`8505f000 C:\WINDOWS\System32\clbcatq.dll ModLoad: 00007ffb`7b0c0000 00007ffb`7b1c1000 C:\Windows\System32\MrmCoreR.dll ModLoad: 00007ffb`84930000 00007ffb`84a1a000 C:\WINDOWS\System32\SHCORE.dll ModLoad: 00007ffb`7a7a0000 00007ffb`7a7cd000 C:\Windows\System32\bcp47mrm.dll ModLoad: 00007ffb`7ae80000 00007ffb`7b008000 C:\Windows\System32\Windows.UI.dll ModLoad: 00007ffb`7cd00000 00007ffb`7cdac000 C:\WINDOWS\system32\uxtheme.dll ModLoad: 00007ffb`79030000 00007ffb`79296000 C:\Windows\System32\twinapi.appcore.dll ModLoad: 00007ffb`80bb0000 00007ffb`80d16000 C:\Windows\System32\WinTypes.dll onecore\com\combase\registrationstore\registrationstore.cpp(7927)\combase.dll!00007FFB843ED8E4: (caller: 00007FFB8434D9C5) ReturnHr(1) tid(4134) 80070002 The system cannot find the file specified. ModLoad: 00007ffb`77d80000 00007ffb`77d9b000 C:\WINDOWS\SYSTEM32\windows.staterepositorycore.dll onecore\com\combase\registrationstore\registrationstore.cpp(7927)\combase.dll!00007FFB843ED8E4: (caller: 00007FFB8434D9C5) ReturnHr(2) tid(4134) 80070002 The system cannot find the file specified. onecore\com\combase\registrationstore\registrationstore.cpp(7927)\combase.dll!00007FFB843ED8E4: (caller: 00007FFB8434D9C5) ReturnHr(3) tid(4134) 80070002 The system cannot find the file specified. ModLoad: 00007ffb`68c50000 00007ffb`68c5b000 C:\ProgramData\Microsoft\Windows\AppRepository\Packages\MicrosoftCorporationII.WindowsSubsystemforLinux_0.48.2.0_x64__8wekyb3d8bbwe\PackagedCom\WslServiceProxyStub.dll D:\a\1\s\src\windows\wsl\main.cpp(1693)\wsl.exe!00007FF73D22F6B2: (caller: 00007FF73D239B9B) Exception(1) tid(4134) 8007023F {Application Error} The application was unable to start correctly (0x%lx). Click OK to close the application. (637c.4134): C++ EH exception - code e06d7363 (first chance) (637c.4134): C++ EH exception - code e06d7363 (first chance) ModLoad: 00007ffb`5b260000 00007ffb`5b2e3000 C:\Windows\System32\execmodelclient.dll ModLoad: 00007ffb`681b0000 00007ffb`681cc000 C:\Windows\System32\Windows.Shell.ServiceHostBuilder.dll ModLoad: 00007ffb`5ca20000 00007ffb`5ca39000 C:\WINDOWS\system32\execmodelproxy.dll onecoreuap\base\appmodel\execmodel\client\applicationinstance\applicationinstance.cpp(58)\execmodelclient.dll!00007FFB5B29CD1C: (caller: 00007FF73D22DCFB) ReturnHr(1) tid(4134) D0000225 CallContext:[\GetActivatedEventArgsClient] (637c.4134): C++ EH exception - code e06d7363 (first chance) (637c.4134): C++ EH exception - code e06d7363 (first chance) D:\a\1\s\src\windows\wsl\main.cpp(458)\wsl.exe!00007FF73D2371A6: (caller: 00007FF73D230D6E) FailFast(1) tid(4134) 8007023E {Application Error} The exception %s (0x(637c.4134): Security check failure or stack buffer overrun - code c0000409 (!!! second chance !!!) Subcode: 0x7 FAST_FAIL_FATAL_APP_EXIT *** WARNING: Unable to verify checksum for wsl.exe KERNELBASE!RaiseFailFastException+0x152: 00007ffb`82d31dd2 0f1f440000 nop dword ptr [rax+rax] 2:017> .dump ^ Non-empty string required in '.dump' windbg> .hh .dump 2:017> .dump /f ***************************************************************************** * .dump /ma is the recommend method of creating a complete memory dump * * of a user mode process. * ***************************************************************************** ^ Non-empty string required in '.dump /f' 2:017> .dump /ma ^ Non-empty string required in '.dump /ma' 2:017> .dump /f fulldump.dmp ***************************************************************************** * .dump /ma is the recommend method of creating a complete memory dump * * of a user mode process. * ***************************************************************************** Unable to create file 'fulldump.dmp' - Win32 error 0n5 "Access is denied." 2:017> .dump /f C:\Users\Matthew\Downloads\fulldump.dmp ***************************************************************************** * .dump /ma is the recommend method of creating a complete memory dump * * of a user mode process. * ***************************************************************************** Creating C:\Users\Matthew\Downloads\fulldump.dmp - user full dump Dump successfully written 2:017> .dump /ma C:\Users\Matthew\Downloads\minidump.dmp Creating C:\Users\Matthew\Downloads\minidump.dmp - mini user dump Dump successfully written 2:017> g WARNING: Continuing a non-continuable exception (637c.4134): Security check failure or stack buffer overrun - code c0000409 (!!! second chance !!!) Subcode: 0x7 FAST_FAIL_FATAL_APP_EXIT wsl+0x707b: 00007ff7`3d22707b cd29 int 29h 2:017> .dump /ma C:\Users\Matthew\Downloads\minidump2.dmp Creating C:\Users\Matthew\Downloads\minidump2.dmp - mini user dump Dump successfully written 2:017> g WARNING: Continuing a non-continuable exception (637c.4134): Security check failure or stack buffer overrun - code c0000409 (!!! second chance !!!) Subcode: 0x7 FAST_FAIL_FATAL_APP_EXIT wsl+0x707b: 00007ff7`3d22707b cd29 int 29h 2:017> g WARNING: Continuing a non-continuable exception (637c.4134): Security check failure or stack buffer overrun - code c0000409 (!!! second chance !!!) Subcode: 0x7 FAST_FAIL_FATAL_APP_EXIT wsl+0x707b: 00007ff7`3d22707b cd29 int 29h NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\atlmfc.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\ObjectiveC.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\concurrency.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\cpp_rest.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\stl.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\Windows.Data.Json.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\Windows.Devices.Geolocation.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\Windows.Devices.Sensors.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\Windows.Media.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\windows.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\winrt.natvis' ``` ### Memory Dump Analysis: **fulldump.dmp**: ``` Microsoft (R) Windows Debugger Version 10.0.22415.1003 AMD64 Copyright (c) Microsoft Corporation. All rights reserved. Loading Dump File [C:\Users\Matthew\Downloads\fulldump.dmp] User Dump File: Only application data is available ************* Path validation summary ************** Response Time (ms) Location Deferred srv* Symbol search path is: srv* Executable search path is: Windows 10 Version 22000 UP Free x64 Product: WinNt, suite: TerminalServer SingleUserTS Personal Machine Name: Debug session time: Sat Oct 30 14:22:19.147 2021 (UTC - 4:00) System Uptime: 0 days 22:10:24.314 Process Uptime: not available .......................................... (637c.4134): Security check failure or stack buffer overrun - code c0000409 (!!! second chance !!!) Subcode: 0x7 FAST_FAIL_FATAL_APP_EXIT For analysis of this file, run !analyze -v *** WARNING: Unable to verify checksum for wsl.exe KERNELBASE!RaiseFailFastException+0x152: 00007ffb`82d31dd2 0f1f440000 nop dword ptr [rax+rax] 0:000> !analyze -v ******************************************************************************* * * * Exception Analysis * * * ******************************************************************************* DEBUG_FLR_EXCEPTION_CODE(8007023e) and the ".exr -1" ExceptionCode(c0000409) don't match KEY_VALUES_STRING: 1 Key : Analysis.CPU.mSec Value: 2280 Key : Analysis.DebugAnalysisManager Value: Create Key : Analysis.Elapsed.mSec Value: 7862 Key : Analysis.Init.CPU.mSec Value: 421 Key : Analysis.Init.Elapsed.mSec Value: 9034 Key : Analysis.Memory.CommitPeak.Mb Value: 113 Key : FailFast.Name Value: FATAL_APP_EXIT Key : FailFast.Type Value: 7 Key : Timeline.OS.Boot.DeltaSec Value: 79824 Key : WER.Process.Version Value: 10.0.10011.16384 NTGLOBALFLAG: 70 PROCESS_BAM_CURRENT_THROTTLED: 0 PROCESS_BAM_PREVIOUS_THROTTLED: 0 APPLICATION_VERIFIER_FLAGS: 0 EXCEPTION_RECORD: (.exr -1) ExceptionAddress: 00007ff73d2371a6 (wsl+0x00000000000171a6) ExceptionCode: c0000409 (Security check failure or stack buffer overrun) ExceptionFlags: 00000001 NumberParameters: 3 Parameter[0]: 0000000000000007 Parameter[1]: ffffffff8007023e Parameter[2]: 00000000000001ca Subcode: 0x7 FAST_FAIL_FATAL_APP_EXIT FAULTING_THREAD: ffffffff PROCESS_NAME: wsl.exe EXCEPTION_CODE_STR: 8007023e CONTEXT: 0000007af9b7e540 -- (.cxr 0x7af9b7e540) rax=00007ffb8576822a rbx=00007ff73d29e0f8 rcx=0000018c0dd70000 rdx=0000018c0dde0bf0 rsi=0000007af9b7ee30 rdi=0000000019930520 rip=00007ffb82c3466c rsp=0000007af9b7ecd0 rbp=0000007af9b7ee50 r8=00007ffb8576910c r9=0000018c0dd70000 r10=0000007a40000062 r11=0000000000000060 r12=0000000000000000 r13=00007ffb831a3900 r14=0000000000000000 r15=0000000000000000 iopl=0 nv up ei pl nz na po nc cs=0033 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00000204 KERNELBASE!RaiseException+0x6c: 00007ffb`82c3466c 0f1f440000 nop dword ptr [rax+rax] Resetting default scope STACK_TEXT: 0000007a`f9b7ecd0 00007ffb`53486480 : 00000000`00000000 0000007a`f9b7ede8 00000000`d0000225 00007ff7`3d22b797 : KERNELBASE!RaiseException+0x6c 0000007a`f9b7edb0 00007ff7`3d23c14a : 00007ffb`5b29cd1c 0000007a`f9b7ef88 0000007a`f9b7ef88 00007ff7`3d2a50d0 : VCRUNTIME140!_CxxThrowException+0x90 0000007a`f9b7ee10 00007ff7`3d22dd27 : 0000007a`f9b7ef88 00007ffb`5b287246 00000000`00000000 00000000`00000000 : wsl+0x1c14a 0000007a`f9b7ee60 00007ff7`3d22ab64 : 00007ff7`3d2a50d8 0000007a`f9b7eef9 00007ff7`3d2a50d0 0000007a`f9b7ef88 : wsl+0xdd27 0000007a`f9b7eea0 00007ff7`3d22c74c : 00007ffb`8327f4f8 00007ffb`00000000 00000000`00000000 0000007a`f9b7f148 : wsl+0xab64 0000007a`f9b7ef60 00007ff7`3d23baec : 00000000`00000000 00000000`00000000 00000000`0000004e 00007ffb`831a3900 : wsl+0xc74c 0000007a`f9b7f000 00007ff7`3d239c03 : 0000007a`f9b7f120 0000007a`f9b7f47e 0000007a`f9b7f47e 0000007a`f9b7f47e : wsl+0x1baec 0000007a`f9b7f050 00007ff7`3d230d6e : 0000007a`f9b7f47c 0000018c`0dd7f370 0000007a`f9b7f47e 0000006c`00730077 : wsl+0x19c03 0000007a`f9b7f3f0 00007ff7`3d23c4f4 : 00000000`00000001 00007ff7`3d26e174 0000018c`0dd81bc0 0000018c`0dd94664 : wsl+0x10d6e 0000007a`f9b7f690 00007ff7`3d265adc : 00000000`00000000 00007ff7`3d265be9 0000018c`0dd7f370 00000000`00000000 : wsl+0x1c4f4 0000007a`f9b7f780 00007ffb`846f54e0 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : wsl+0x45adc 0000007a`f9b7f7c0 00007ffb`8574485b : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : KERNEL32!BaseThreadInitThunk+0x10 0000007a`f9b7f7f0 00000000`00000000 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!RtlUserThreadStart+0x2b STACK_COMMAND: .cxr 7af9b7e540 ; kb ; .cxr 0x7af9b7e540 ; kb SYMBOL_NAME: wsl+1c14a MODULE_NAME: wsl IMAGE_NAME: wsl.exe BUCKET_ID_MODPRIVATE: 1 FAILURE_BUCKET_ID: FAIL_FAST_FATAL_APP_EXIT_8007023e_wsl.exe!Unknown OSPLATFORM_TYPE: x64 OSNAME: Windows 10 IMAGE_VERSION: 10.0.10011.16384 FAILURE_ID_HASH: {c86a08ff-5f4e-b421-710b-3f35cdd1b5ca} Followup: MachineOwner --------- NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\atlmfc.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\ObjectiveC.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\concurrency.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\cpp_rest.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\stl.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\Windows.Data.Json.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\Windows.Devices.Geolocation.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\Windows.Devices.Sensors.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\Windows.Media.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\windows.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\winrt.natvis' ``` **minidump.dmp**: ``` Microsoft (R) Windows Debugger Version 10.0.22415.1003 AMD64 Copyright (c) Microsoft Corporation. All rights reserved. Loading Dump File [C:\Users\Matthew\Downloads\minidump.dmp] User Mini Dump File with Full Memory: Only application data is available ************* Path validation summary ************** Response Time (ms) Location Deferred srv* Symbol search path is: srv* Executable search path is: Windows 10 Version 22000 MP (8 procs) Free x64 Product: WinNt, suite: SingleUserTS Personal Edition build lab: 22000.1.amd64fre.co_release.210604-1628 Machine Name: Debug session time: Sat Oct 30 14:22:32.000 2021 (UTC - 4:00) System Uptime: 0 days 22:10:37.851 Process Uptime: 0 days 0:02:49.000 .......................................... This dump file has an exception of interest stored in it. The stored exception information can be accessed via .ecxr. (637c.4134): Security check failure or stack buffer overrun - code c0000409 (first/second chance not available) Subcode: 0x7 FAST_FAIL_FATAL_APP_EXIT For analysis of this file, run !analyze -v *** WARNING: Unable to verify checksum for wsl.exe KERNELBASE!RaiseFailFastException+0x152: 00007ffb`82d31dd2 0f1f440000 nop dword ptr [rax+rax] 0:000> !analyze -v ******************************************************************************* * * * Exception Analysis * * * ******************************************************************************* DEBUG_FLR_EXCEPTION_CODE(8007023e) and the ".exr -1" ExceptionCode(c0000409) don't match KEY_VALUES_STRING: 1 Key : Analysis.CPU.mSec Value: 1656 Key : Analysis.DebugAnalysisManager Value: Create Key : Analysis.Elapsed.mSec Value: 1817 Key : Analysis.Init.CPU.mSec Value: 358 Key : Analysis.Init.Elapsed.mSec Value: 4020 Key : Analysis.Memory.CommitPeak.Mb Value: 113 Key : FailFast.Name Value: FATAL_APP_EXIT Key : FailFast.Type Value: 7 Key : Timeline.OS.Boot.DeltaSec Value: 79837 Key : Timeline.Process.Start.DeltaSec Value: 169 Key : WER.OS.Branch Value: co_release Key : WER.OS.Timestamp Value: 2021-06-04T16:28:00Z Key : WER.OS.Version Value: 10.0.22000.1 Key : WER.Process.Version Value: 10.0.10011.16384 NTGLOBALFLAG: 70 PROCESS_BAM_CURRENT_THROTTLED: 0 PROCESS_BAM_PREVIOUS_THROTTLED: 0 APPLICATION_VERIFIER_FLAGS: 0 CONTEXT: 0000007af9b7e540 -- (.cxr 0x7af9b7e540) rax=00007ffb8576822a rbx=00007ff73d29e0f8 rcx=0000018c0dd70000 rdx=0000018c0dde0bf0 rsi=0000007af9b7ee30 rdi=0000000019930520 rip=00007ffb82c3466c rsp=0000007af9b7ecd0 rbp=0000007af9b7ee50 r8=00007ffb8576910c r9=0000018c0dd70000 r10=0000007a40000062 r11=0000000000000060 r12=0000000000000000 r13=00007ffb831a3900 r14=0000000000000000 r15=0000000000000000 iopl=0 nv up ei pl nz na po nc cs=0033 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00000204 KERNELBASE!RaiseException+0x6c: 00007ffb`82c3466c 0f1f440000 nop dword ptr [rax+rax] Resetting default scope EXCEPTION_RECORD: (.exr -1) ExceptionAddress: 00007ff73d2371a6 (wsl+0x00000000000171a6) ExceptionCode: c0000409 (Security check failure or stack buffer overrun) ExceptionFlags: 00000001 NumberParameters: 3 Parameter[0]: 0000000000000007 Parameter[1]: ffffffff8007023e Parameter[2]: 00000000000001ca Subcode: 0x7 FAST_FAIL_FATAL_APP_EXIT PROCESS_NAME: wsl.exe EXCEPTION_CODE_STR: 8007023e FAULTING_THREAD: ffffffff STACK_TEXT: 0000007a`f9b7ecd0 00007ffb`53486480 : 00000000`00000000 0000007a`f9b7ede8 00000000`d0000225 00007ff7`3d22b797 : KERNELBASE!RaiseException+0x6c 0000007a`f9b7edb0 00007ff7`3d23c14a : 00007ffb`5b29cd1c 0000007a`f9b7ef88 0000007a`f9b7ef88 00007ff7`3d2a50d0 : VCRUNTIME140!_CxxThrowException+0x90 0000007a`f9b7ee10 00007ff7`3d22dd27 : 0000007a`f9b7ef88 00007ffb`5b287246 00000000`00000000 00000000`00000000 : wsl+0x1c14a 0000007a`f9b7ee60 00007ff7`3d22ab64 : 00007ff7`3d2a50d8 0000007a`f9b7eef9 00007ff7`3d2a50d0 0000007a`f9b7ef88 : wsl+0xdd27 0000007a`f9b7eea0 00007ff7`3d22c74c : 00007ffb`8327f4f8 00007ffb`00000000 00000000`00000000 0000007a`f9b7f148 : wsl+0xab64 0000007a`f9b7ef60 00007ff7`3d23baec : 00000000`00000000 00000000`00000000 00000000`0000004e 00007ffb`831a3900 : wsl+0xc74c 0000007a`f9b7f000 00007ff7`3d239c03 : 0000007a`f9b7f120 0000007a`f9b7f47e 0000007a`f9b7f47e 0000007a`f9b7f47e : wsl+0x1baec 0000007a`f9b7f050 00007ff7`3d230d6e : 0000007a`f9b7f47c 0000018c`0dd7f370 0000007a`f9b7f47e 0000006c`00730077 : wsl+0x19c03 0000007a`f9b7f3f0 00007ff7`3d23c4f4 : 00000000`00000001 00007ff7`3d26e174 0000018c`0dd81bc0 0000018c`0dd94664 : wsl+0x10d6e 0000007a`f9b7f690 00007ff7`3d265adc : 00000000`00000000 00007ff7`3d265be9 0000018c`0dd7f370 00000000`00000000 : wsl+0x1c4f4 0000007a`f9b7f780 00007ffb`846f54e0 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : wsl+0x45adc 0000007a`f9b7f7c0 00007ffb`8574485b : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : kernel32!BaseThreadInitThunk+0x10 0000007a`f9b7f7f0 00000000`00000000 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : ntdll!RtlUserThreadStart+0x2b STACK_COMMAND: .cxr 7af9b7e540 ; kb ; .cxr 0x7af9b7e540 ; kb SYMBOL_NAME: wsl+1c14a MODULE_NAME: wsl IMAGE_NAME: wsl.exe BUCKET_ID_MODPRIVATE: 1 FAILURE_BUCKET_ID: FAIL_FAST_FATAL_APP_EXIT_8007023e_wsl.exe!Unknown OS_VERSION: 10.0.22000.1 BUILDLAB_STR: co_release OSPLATFORM_TYPE: x64 OSNAME: Windows 10 IMAGE_VERSION: 10.0.10011.16384 FAILURE_ID_HASH: {c86a08ff-5f4e-b421-710b-3f35cdd1b5ca} Followup: MachineOwner --------- NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\atlmfc.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\ObjectiveC.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\concurrency.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\cpp_rest.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\stl.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\Windows.Data.Json.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\Windows.Devices.Geolocation.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\Windows.Devices.Sensors.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\Windows.Media.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\windows.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\winrt.natvis' ``` **minidump2.dmp**: ``` Microsoft (R) Windows Debugger Version 10.0.22415.1003 AMD64 Copyright (c) Microsoft Corporation. All rights reserved. Loading Dump File [C:\Users\Matthew\Downloads\minidump2.dmp] User Mini Dump File with Full Memory: Only application data is available ************* Path validation summary ************** Response Time (ms) Location Deferred srv* Symbol search path is: srv* Executable search path is: Windows 10 Version 22000 MP (8 procs) Free x64 Product: WinNt, suite: SingleUserTS Personal Edition build lab: 22000.1.amd64fre.co_release.210604-1628 Machine Name: Debug session time: Sat Oct 30 14:23:10.000 2021 (UTC - 4:00) System Uptime: 0 days 22:11:16.075 Process Uptime: 0 days 0:03:27.000 .......................................... This dump file has an exception of interest stored in it. The stored exception information can be accessed via .ecxr. (637c.4134): Security check failure or stack buffer overrun - code c0000409 (first/second chance not available) Subcode: 0x7 FAST_FAIL_FATAL_APP_EXIT For analysis of this file, run !analyze -v *** WARNING: Unable to verify checksum for wsl.exe wsl+0x707b: 00007ff7`3d22707b cd29 int 29h 0:000> !analyze -v ******************************************************************************* * * * Exception Analysis * * * ******************************************************************************* KEY_VALUES_STRING: 1 Key : Analysis.CPU.mSec Value: 1593 Key : Analysis.DebugAnalysisManager Value: Create Key : Analysis.Elapsed.mSec Value: 1869 Key : Analysis.Init.CPU.mSec Value: 406 Key : Analysis.Init.Elapsed.mSec Value: 2668 Key : Analysis.Memory.CommitPeak.Mb Value: 137 Key : FailFast.Name Value: FATAL_APP_EXIT Key : FailFast.Type Value: 7 Key : Timeline.OS.Boot.DeltaSec Value: 79876 Key : Timeline.Process.Start.DeltaSec Value: 207 Key : WER.OS.Branch Value: co_release Key : WER.OS.Timestamp Value: 2021-06-04T16:28:00Z Key : WER.OS.Version Value: 10.0.22000.1 Key : WER.Process.Version Value: 10.0.10011.16384 NTGLOBALFLAG: 70 PROCESS_BAM_CURRENT_THROTTLED: 0 PROCESS_BAM_PREVIOUS_THROTTLED: 0 APPLICATION_VERIFIER_FLAGS: 0 CONTEXT: (.ecxr) rax=0000007af9b79eb0 rbx=0000007af9b7a510 rcx=0000000000000007 rdx=0000007af9b7a360 rsi=00007ff73d230d6e rdi=0000000000000001 rip=00007ff73d22707b rsp=0000007af9b7a3e0 rbp=0000007af9b7a5e0 r8=0000000000000000 r9=0000007af9b7a320 r10=00000fff705a6391 r11=0000000000020000 r12=0000000000000000 r13=0000000000000000 r14=00000000000001ca r15=00007ff73d26eeb8 iopl=0 nv up ei pl nz na pe nc cs=0033 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00000202 wsl+0x707b: 00007ff7`3d22707b cd29 int 29h Resetting default scope EXCEPTION_RECORD: (.exr -1) ExceptionAddress: 00007ff73d22707b (wsl+0x000000000000707b) ExceptionCode: c0000409 (Security check failure or stack buffer overrun) ExceptionFlags: 00000001 NumberParameters: 1 Parameter[0]: 0000000000000007 Subcode: 0x7 FAST_FAIL_FATAL_APP_EXIT PROCESS_NAME: wsl.exe ERROR_CODE: (NTSTATUS) 0xc0000409 - The system detected an overrun of a stack-based buffer in this application. This overrun could potentially allow a malicious user to gain control of this application. EXCEPTION_CODE_STR: c0000409 EXCEPTION_PARAMETER1: 0000000000000007 FAULTING_THREAD: ffffffff STACK_TEXT: 0000007a`f9b7ecd0 00007ffb`82c3466c KERNELBASE!RaiseException+0x6c 0000007a`f9b7edb0 00007ffb`53486480 VCRUNTIME140!_CxxThrowException+0x90 0000007a`f9b7ee10 00007ff7`3d23c14a wsl+0x1c14a 0000007a`f9b7ee60 00007ff7`3d22dd27 wsl+0xdd27 0000007a`f9b7eea0 00007ff7`3d22ab64 wsl+0xab64 0000007a`f9b7ef60 00007ff7`3d22c74c wsl+0xc74c 0000007a`f9b7f000 00007ff7`3d23baec wsl+0x1baec 0000007a`f9b7f050 00007ff7`3d239c03 wsl+0x19c03 0000007a`f9b7f3f0 00007ff7`3d230d6e wsl+0x10d6e 0000007a`f9b7f690 00007ff7`3d23c4f4 wsl+0x1c4f4 0000007a`f9b7f780 00007ff7`3d265adc wsl+0x45adc 0000007a`f9b7f7c0 00007ffb`846f54e0 kernel32!BaseThreadInitThunk+0x10 0000007a`f9b7f7f0 00007ffb`8574485b ntdll!RtlUserThreadStart+0x2b SYMBOL_NAME: wsl+1c14a MODULE_NAME: wsl IMAGE_NAME: wsl.exe STACK_COMMAND: .cxr 7af9b7e540 ; kb ; ** Pseudo Context ** Pseudo ** Value: 1bfdb1f4000 ** ; kb BUCKET_ID_MODPRIVATE: 1 FAILURE_BUCKET_ID: FAIL_FAST_FATAL_APP_EXIT_c0000409_wsl.exe!Unknown OS_VERSION: 10.0.22000.1 BUILDLAB_STR: co_release OSPLATFORM_TYPE: x64 OSNAME: Windows 10 IMAGE_VERSION: 10.0.10011.16384 FAILURE_ID_HASH: {2e63dc9d-b85f-9d2a-c868-a2a28c186178} Followup: MachineOwner --------- NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\atlmfc.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\ObjectiveC.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\concurrency.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\cpp_rest.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\stl.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\Windows.Data.Json.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\Windows.Devices.Geolocation.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\Windows.Devices.Sensors.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\Windows.Media.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\windows.natvis' NatVis script unloaded from 'C:\Program Files\WindowsApps\Microsoft.WinDbg_1.2108.26002.0_neutral__8wekyb3d8bbwe\amd64\Visualizers\winrt.natvis' ``` ### Feedback Hub report: [Report link](https://aka.ms/AAel4pl) Note: This report contains the memory dumps. Unfortunately, Feedback Hub gave me an error when I tried to record the problem. ### WSL logs [removed]

Please let me know if there is anything else I can do to help you debug this issue.

benhillis commented 2 years ago

@OneBlue - could you please take a look?

OneBlue commented 2 years ago

Thanks for reporting this @MatthewL246

This could be caused by a mismatch in the CRT.

Can you please share the output of get-appxpackage | where {$_.Name.contains("UWP")} in a powershell prompt ?

MatthewL246 commented 2 years ago

@OneBlue Here is the output:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\Users\Matthew> get-appxpackage | where {$_.Name.contains("UWP")}

Name              : Microsoft.VCLibs.140.00.UWPDesktop
Publisher         : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture      : X64
ResourceId        :
Version           : 14.0.29231.0
PackageFullName   : Microsoft.VCLibs.140.00.UWPDesktop_14.0.29231.0_x64__8wekyb3d8bbwe
InstallLocation   : C:\Program Files\WindowsApps\Microsoft.VCLibs.140.00.UWPDesktop_14.0.29231.0_x64__8wekyb3d8bbwe
IsFramework       : True
PackageFamilyName : Microsoft.VCLibs.140.00.UWPDesktop_8wekyb3d8bbwe
PublisherId       : 8wekyb3d8bbwe
IsResourcePackage : False
IsBundle          : False
IsDevelopmentMode : False
NonRemovable      : False
IsPartiallyStaged : False
SignatureKind     : Store
Status            : Ok

Name              : Microsoft.VCLibs.120.00.UWPDesktop
Publisher         : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture      : X86
ResourceId        :
Version           : 12.0.40653.0
PackageFullName   : Microsoft.VCLibs.120.00.UWPDesktop_12.0.40653.0_x86__8wekyb3d8bbwe
InstallLocation   : C:\Program Files\WindowsApps\Microsoft.VCLibs.120.00.UWPDesktop_12.0.40653.0_x86__8wekyb3d8bbwe
IsFramework       : True
PackageFamilyName : Microsoft.VCLibs.120.00.UWPDesktop_8wekyb3d8bbwe
PublisherId       : 8wekyb3d8bbwe
IsResourcePackage : False
IsBundle          : False
IsDevelopmentMode : False
NonRemovable      : False
IsPartiallyStaged : False
SignatureKind     : Store
Status            : Ok

Name              : Microsoft.VCLibs.120.00.UWPDesktop
Publisher         : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture      : X64
ResourceId        :
Version           : 12.0.40653.0
PackageFullName   : Microsoft.VCLibs.120.00.UWPDesktop_12.0.40653.0_x64__8wekyb3d8bbwe
InstallLocation   : C:\Program Files\WindowsApps\Microsoft.VCLibs.120.00.UWPDesktop_12.0.40653.0_x64__8wekyb3d8bbwe
IsFramework       : True
PackageFamilyName : Microsoft.VCLibs.120.00.UWPDesktop_8wekyb3d8bbwe
PublisherId       : 8wekyb3d8bbwe
IsResourcePackage : False
IsBundle          : False
IsDevelopmentMode : False
NonRemovable      : False
IsPartiallyStaged : False
SignatureKind     : Store
Status            : Ok

Name              : Microsoft.VCLibs.110.00.UWPDesktop
Publisher         : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture      : X64
ResourceId        :
Version           : 11.0.61135.0
PackageFullName   : Microsoft.VCLibs.110.00.UWPDesktop_11.0.61135.0_x64__8wekyb3d8bbwe
InstallLocation   : C:\Program Files\WindowsApps\Microsoft.VCLibs.110.00.UWPDesktop_11.0.61135.0_x64__8wekyb3d8bbwe
IsFramework       : True
PackageFamilyName : Microsoft.VCLibs.110.00.UWPDesktop_8wekyb3d8bbwe
PublisherId       : 8wekyb3d8bbwe
IsResourcePackage : False
IsBundle          : False
IsDevelopmentMode : False
NonRemovable      : False
IsPartiallyStaged : False
SignatureKind     : Store
Status            : Ok

Name              : Microsoft.VCLibs.110.00.UWPDesktop
Publisher         : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture      : X86
ResourceId        :
Version           : 11.0.61135.0
PackageFullName   : Microsoft.VCLibs.110.00.UWPDesktop_11.0.61135.0_x86__8wekyb3d8bbwe
InstallLocation   : C:\Program Files\WindowsApps\Microsoft.VCLibs.110.00.UWPDesktop_11.0.61135.0_x86__8wekyb3d8bbwe
IsFramework       : True
PackageFamilyName : Microsoft.VCLibs.110.00.UWPDesktop_8wekyb3d8bbwe
PublisherId       : 8wekyb3d8bbwe
IsResourcePackage : False
IsBundle          : False
IsDevelopmentMode : False
NonRemovable      : False
IsPartiallyStaged : False
SignatureKind     : Store
Status            : Ok

Name              : Microsoft.VCLibs.140.00.UWPDesktop
Publisher         : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture      : X86
ResourceId        :
Version           : 14.0.30704.0
PackageFullName   : Microsoft.VCLibs.140.00.UWPDesktop_14.0.30704.0_x86__8wekyb3d8bbwe
InstallLocation   : C:\Program Files\WindowsApps\Microsoft.VCLibs.140.00.UWPDesktop_14.0.30704.0_x86__8wekyb3d8bbwe
IsFramework       : True
PackageFamilyName : Microsoft.VCLibs.140.00.UWPDesktop_8wekyb3d8bbwe
PublisherId       : 8wekyb3d8bbwe
IsResourcePackage : False
IsBundle          : False
IsDevelopmentMode : False
NonRemovable      : False
IsPartiallyStaged : False
SignatureKind     : Store
Status            : Ok

Name              : Microsoft.VCLibs.140.00.UWPDesktop
Publisher         : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture      : X64
ResourceId        :
Version           : 14.0.30704.0
PackageFullName   : Microsoft.VCLibs.140.00.UWPDesktop_14.0.30704.0_x64__8wekyb3d8bbwe
InstallLocation   : C:\Program Files\WindowsApps\Microsoft.VCLibs.140.00.UWPDesktop_14.0.30704.0_x64__8wekyb3d8bbwe
IsFramework       : True
PackageFamilyName : Microsoft.VCLibs.140.00.UWPDesktop_8wekyb3d8bbwe
PublisherId       : 8wekyb3d8bbwe
IsResourcePackage : False
IsBundle          : False
IsDevelopmentMode : False
NonRemovable      : False
IsPartiallyStaged : False
SignatureKind     : Store
Status            : Ok

Name              : Microsoft.VCLibs.140.00.UWPDesktop
Publisher         : CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
Architecture      : X64
ResourceId        :
Version           : 14.0.30035.0
PackageFullName   : Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x64__8wekyb3d8bbwe
InstallLocation   : C:\Program Files\WindowsApps\Microsoft.VCLibs.140.00.UWPDesktop_14.0.30035.0_x64__8wekyb3d8bbwe
IsFramework       : True
PackageFamilyName : Microsoft.VCLibs.140.00.UWPDesktop_8wekyb3d8bbwe
PublisherId       : 8wekyb3d8bbwe
IsResourcePackage : False
IsBundle          : False
IsDevelopmentMode : False
NonRemovable      : False
IsPartiallyStaged : False
SignatureKind     : Store
Status            : Ok
OneBlue commented 2 years ago

Ok I can see that the correct version of the CRT is installed so the problem is elsewhere.

Can you try running Dependency walker on C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemforLinux_0.48.2.0_x64__8wekyb3d8bbwe\wsl.exe ?

I wonder if another dll is missing

MatthewL246 commented 2 years ago

@OneBlue When I try to run dependency walker on wsl.exe, it freezes and then crashes. Is there another program I can try? Maybe you could use those ModLoad outputs.

OneBlue commented 2 years ago

Ok, let's try a different approach. Does this succeed in an elevated powershell prompt ?

Start-Service WslService ; Get-Service WslService
OneBlue commented 2 years ago

Forget it, can see in the logs that the service is starting correctly. The issue is when starting wslhost.exe.

I'll have a deeper look tomorrow

OneBlue commented 2 years ago

Actually one more question: Does this reproduce with elevated and un-elevated command prompts ?

xmine64 commented 2 years ago

@OneBlue Yes, I have same problem and I can reproduce it in a elevated command prompt.

xmine64 commented 2 years ago

@OneBlue Check this: image

image

MatthewL246 commented 2 years ago

@OneBlue Yes, the service starts successfully. The same problem occurs whether I use an elevated or non-elevated command prompt. @minusium I have the same results, C:\Windows\System32\wsl.exe and C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemforLinux_0.48.2.0_x64__8wekyb3d8bbwe\wsl.exe fail but C:\Users\Matthew\AppData\Local\Microsoft\WindowsApps\wsl.exe works.

OneBlue commented 2 years ago

Thank you @MatthewL246. It's really interesting that you're seeing different behaviors between: C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemforLinux_0.48.2.0_x64__8wekyb3d8bbwe\wsl.exe and C:\Users\Matthew\AppData\Local\Microsoft\WindowsApps\wsl.exe. It might be that the reparse points are not configured correctly.

Can you share the output of:


get-acl "C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemforLinux_0.48.2.0_x64__8wekyb3d8bbwe\wsl.exe"  | format-list 

get-acl "C:\Users\Matthew\AppData\Local\Microsoft\WindowsApps\wsl.exe"  | format-list 
``` ?
MatthewL246 commented 2 years ago

@OneBlue Here is the output:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\Users\Matthew> get-acl "C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemforLinux_0.48.2.0_x64__8wekyb3d8bbwe\wsl.exe" | format-list

Path   : Microsoft.PowerShell.Core\FileSystem::C:\Program
         Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemforLinux_0.48.2.0_x64__8wekyb3d8bbwe\wsl.exe
Owner  : NT AUTHORITY\SYSTEM
Group  : NT AUTHORITY\SYSTEM
Access : BUILTIN\Users Allow  ReadAndExecute, Synchronize
         S-1-15-3-429212343-3647803101-1591801556-3956432790-4290114561-3840431764-837144133 Allow  ReadAndExecute,
         Synchronize
         BUILTIN\Users Allow  Read, Synchronize
         NT SERVICE\TrustedInstaller Allow  FullControl
         S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204 Allow
         ReadAndExecute, Synchronize
         NT AUTHORITY\SYSTEM Allow  FullControl
         BUILTIN\Administrators Allow  FullControl
         NT AUTHORITY\LOCAL SERVICE Allow  ReadAndExecute, Synchronize
         NT AUTHORITY\NETWORK SERVICE Allow  ReadAndExecute, Synchronize
         NT AUTHORITY\RESTRICTED Allow  ReadAndExecute, Synchronize
         MATTHEW-LAPTOP\Matthew Allow  ReadAndExecute, Synchronize
         BUILTIN\Users Allow  ReadAndExecute, Synchronize
Audit  :
Sddl   : O:SYG:SYD:AI(XA;ID;0x1200a9;;;BU;(WIN://SYSAPPID Contains "MICROSOFTCORPORATIONII.WINDOWSSUBSYSTEMFORLINUX_8W
         EKYB3D8BBWE"))(A;ID;0x1200a9;;;S-1-15-3-429212343-3647803101-1591801556-3956432790-4290114561-3840431764-8371
         44133)(A;ID;FR;;;BU)(A;ID;FA;;;S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464)(A;ID;0x1200a9;
         ;;S-1-15-3-1024-3635283841-2530182609-996808640-1887759898-3848208603-3313616867-983405619-2501854204)(A;ID;F
         A;;;SY)(A;ID;FA;;;BA)(A;ID;0x1200a9;;;LS)(A;ID;0x1200a9;;;NS)(A;ID;0x1200a9;;;RC)(A;ID;0x1200a9;;;S-1-5-21-33
         0327545-1755506854-1264941450-1001)(A;ID;0x1200a9;;;BU)

PS C:\Users\Matthew> get-acl "C:\Users\Matthew\AppData\Local\Microsoft\WindowsApps\wsl.exe" | format-list

Path   : Microsoft.PowerShell.Core\FileSystem::C:\Users\Matthew\AppData\Local\Microsoft\WindowsApps\wsl.exe
Owner  : MATTHEW-LAPTOP\Matthew
Group  : MATTHEW-LAPTOP\Matthew
Access : NT AUTHORITY\SYSTEM Allow  FullControl
         BUILTIN\Administrators Allow  FullControl
         MATTHEW-LAPTOP\Matthew Allow  FullControl
Audit  :
Sddl   : O:S-1-5-21-330327545-1755506854-1264941450-1001G:S-1-5-21-330327545-1755506854-1264941450-1001D:(A;ID;FA;;;SY
         )(A;ID;FA;;;BA)(A;ID;FA;;;S-1-5-21-330327545-1755506854-1264941450-1001)

PS C:\Users\Matthew> get-acl "C:\Windows\System32\wsl.exe" | format-list

Path   : Microsoft.PowerShell.Core\FileSystem::C:\Windows\System32\wsl.exe
Owner  : NT SERVICE\TrustedInstaller
Group  : NT SERVICE\TrustedInstaller
Access : NT AUTHORITY\SYSTEM Allow  ReadAndExecute, Synchronize
         BUILTIN\Administrators Allow  ReadAndExecute, Synchronize
         BUILTIN\Users Allow  ReadAndExecute, Synchronize
         NT SERVICE\TrustedInstaller Allow  FullControl
         APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES Allow  ReadAndExecute, Synchronize
         APPLICATION PACKAGE AUTHORITY\ALL RESTRICTED APPLICATION PACKAGES Allow  ReadAndExecute, Synchronize
Audit  :
Sddl   : O:S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464G:S-1-5-80-956008885-3418522649-1831038044-18
         53292631-2271478464D:PAI(A;;0x1200a9;;;SY)(A;;0x1200a9;;;BA)(A;;0x1200a9;;;BU)(A;;FA;;;S-1-5-80-956008885-341
         8522649-1831038044-1853292631-2271478464)(A;;0x1200a9;;;AC)(A;;0x1200a9;;;S-1-15-2-2)

I would not be surprised if it's a permissions issue since I have done the "take ownership of the WindowsApps folder" tweak in the past. I have since reverted it SYSTEM/TrustedInstaller ownership. I did keep read access for myself, as you can see, so that might be causing the problems.

OneBlue commented 2 years ago

Oh this is interesting. It could definitely affect this path.

Did you do that before or after installing WSL ?

What if you run (elevated powershell)

Remove-AppxPackage (get-appxpackage MicrosoftCorporationII.WindowsSubsystemforLinux -Allusers) -AllUsers

And then install from the store again ? I wonder if that's enough to reset the ACL

MatthewL246 commented 2 years ago

@OneBlue I have done tweak several times. I remember doing it with Windows 10 after installing WSL 1 and 2 but before the WSL preview app was released. I did it again after the Windows 11 upgrade, which I think reset it, and after installing WSL preview from the store this time. I have only done it to view the files in WindowsApps; I have not run any of those "Windows 10 debloater" scripts.

I have tried uninstalling and reinstalling WSL preview a couple times, but I have not tried running that command (with -AllUsers) yet. I will do it now.

Note to self: WSL link, WSA link.

MatthewL246 commented 2 years ago

@OneBlue Unfortunately, removing the package and reinstalling does not solve the problem. I have also tried the "Repair" and "Reset" buttons in the Settings app, but they do not help either.

xmine64 commented 2 years ago

I did same to WindowsApps folder too, but I reverted it a long time before installing WSL and I never did that again.

Btw what does 0xlx means?

OneBlue commented 2 years ago

@MatthewL246 thanks for your replies, I think we figured it out.

So there are two issues here:

1) WSL fails to properly start

That's caused by the permission change you mentioned. I was able to reproduce this issue by changing the permissions of WindowsApps as well, and I was able to recover by doing the following actions:

The core issue is that if the permissions of the WindowsApps are not what's expected, the ACL's for wsl.exe & wslhost.exe are wrong, and the processes fail to start correctly.

You can check that the permissions are correct by running get-acl "C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemforLinux_0.49.1.23_x64__8wekyb3d8bbwe\wsl.exe" | Format-List

If you do NOT see something like:

 my-machine\my-account Allow  FullControl

Then the permissions are CORRECT.

2) wsl.exe fails to correctly handle this error

This specific error triggers a bad code path in wsl.exe and ends up crashing. This will be fixed in the next release.

Anyway, thanks a lot for the high-quality issue @MatthewL246. Let me know if the above instructions to restore WSL work for you

MatthewL246 commented 2 years ago

@OneBlue Thanks for the fix! I'm glad that I was able to help with my high-quality issue, even if it was just caused by a configuration problem on my end. I hope that this issue can help anyone else who encounters this problem and googles it.

@minusium I'm just mentioning you so that you can see the fix.

MatthewL246 commented 2 years ago

Here is a simple tutorial for the fix:

  1. Make sure that File Explorer is set to show hidden and system files.
  2. Open File Explorer to C:\Program Files\
  3. Right-click WindowsApps and open properties, then open the advanced security options.
  4. Remove any specific user accounts (usually with Full Control) from the list and click Apply.
  5. Click "Change" next to the "Owner:" line and accept the UAC dialog.
  6. Paste NT SERVICE\TrustedInstaller into the box, then click "Check Names" and OK.
  7. Check the box next to "Replace owner on subcontianers and objects" and click OK.
  8. In an elevated PowerShell window, run Remove-AppxPackage (get-appxpackage MicrosoftCorporationII.WindowsSubsystemforLinux -Allusers) -AllUsers
  9. Reinstall the WSL Preview app from the Microsoft Store here.
  10. To check the permissions, run get-acl "C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemforLinux_0.48.2.0_x64__8wekyb3d8bbwe\wsl.exe" | Format-List and make sure that it is owned by NT SERVICE\TrustedInstaller and that your user account does not have access.
pupa57 commented 2 years ago

I have exactly the same problem. It all started after when I installed GWLS from store. Uninstalling it cleared the problem. Then I tried installing GWSL again and at first all was ok and everything worked as normal, Until I rebooted. Even after uninstalling GWLS again did not help.

Strangest is that if I open WSL preview or Ubuntu 20.04 from store, all works fine again until I reboot. Then I have to open the app from store again to make it work.

Hope this helps.

PS: Just further tested and confirmed again. Once I used Store to open the WSL preview APP WSL, shows running from terminal wsl -l -v. Everything then works as normal untill I shut down WSL with wsl --shutdown. Then problen persists again.

PS C:\Users\Developers> wsl {Application Error} The application was unable to start correctly (0xlx). Click OK to close the application.

Stating WSL by open app in store started WSL distro OK.

image

image

Closing all Windows shows WSL stopped.

PS C:\Users\Developers> wsl -l -v NAME STATE VERSION

Open again WSL app from STORE starts WSL PS C:\Users\Developers> wsl -l -v NAME STATE VERSION

Bottom line with this method is... You cannot close WSL Distro windows as WSL stops running.

MatthewL246 commented 2 years ago

@pupa57 Yes, that looks like the same issue I faced. Have you tried the tutorial for the fix I posted?

pupa57 commented 2 years ago

@MatthewL246 Yes, Thank you.

jerryasher commented 2 years ago

@MatthewL246 thanks for your the detailed discussion and the fix, which sort of worked, but didn't :(

Using your fix, I was able to get wsl -l -v and wsl working again, but when I tried wsl --import it failed with the old familiar sting

jerry@DELL5570 c:\wsl>wsl --import dubu20 c:\wsl\dubu20 c:\wsl\dubuntu20.export.wsl
Import in progress, this may take a few minutes
{Application Error}
The application was unable to start correctly (0xlx). Click OK to close the application.

jerry@DELL5570 c:\wsl>wsl -l -v
  NAME     STATE           VERSION
* ubu20    Stopped         2

jerry@DELL5570 c:\wsl>wsl
{Application Error}
The application was unable to start correctly (0xlx). Click OK to close the application.

Now, due to my lack of Windows knowledge, I wasn't able to clean up the WinApps folder as cleanly as I would have liked, in the end it looked like:

image

And I'm not sure what that Account Unknown... represents or how to delete it

Similarly, I am not sure if I need to remove the entries for Users or Administrators that would seem to apply to my account, but do not have the specificity you suggested was required.

For what it's worth, my journey towards this today started when I was trying to understand why I couldn't start a wsl session when I ssh'd into the Windows 11 host.

Eventually I discovered at that point that while I could get get wsl -l -v to work from a powershell, I could not get it to work once I used Windows OpenSSH to ssh back into the same host.

> wsl -l -v

> ssh localhost
> wsl -l -v
Access is denied.
MatthewL246 commented 2 years ago

@jerryasher Unfortunately, I am not sure how to completely fix the problem. I would recommend just not touching the WindowsApps folder for now and waiting for the fix to be released.

One suggestion is that you can use C:\Users\your-username\AppData\Local\Microsoft\WindowsApps\wsl.exe instead of wsl.exe in System32. You can try adding the above path to your Windows PATH environment variable.

MatthewL246 commented 2 years ago

This problem was not solved in WSL Preview version 0.50.2. The PATH tweak (see above) still works though. Note: you might need to rearrange the order of the paths in the PATH environment variable so that %USERPROFILE%\AppData\Local\Microsoft\WindowsApps takes precedence over C:\Windows\System32.

Default Distribution: Ubuntu
Default Version: 2
WSL version: 0.50.2.0
Kernel version: 5.10.74.3
WSLg version: 1.0.29
Windows version: 10.0.22000.346
xmine64 commented 2 years ago

@MatthewL246 Maybe just deleting C:\Windows\System32\wsl.exe =)))

zstg commented 2 years ago

WSL does have a timeout right? I think this can be configured in the Insider builds if I'm not wrong - I see that \Users\DELL\AppData\Local\Microsoft\WindowsApps\wsl.exe and \Windows\System32\wsl.exe return the 0x1x error for me when i open them from an elevated/othewise cmd/powershell - But if i right click the Start Menu shortcut and open the executable as admin , wsl seems to start without a hitch I've tried and tested this on Ubuntu , Debian and Mint - and I've noted that the error occurs a lot more frequently on Debian and the least on Mint

This error does not seem to happen on my other device - which has the exact same Store version of WSL

I get the error when i "wake" up WSL from sleep - or when i execute wsl --shutdown && wsl -d Mint

I do notice that i get the error very rarely when i use the docker-desktop distro ( though it's not very useful is it 😅?)

xmine64 commented 2 years ago

@ZeRealStig It's 0xlx, not "One", It's small L In new update, now it's 0x%ulx I guess there's a bug in string formatter so it shows the format string instead of putting real error code in its place.

zstg commented 2 years ago

Yes,thank you 😅

Sorry

pronoy2108 commented 2 years ago

Remove

It worked like a charm for me (after running it with elevated privs.) and wsl seems to be working again!

liudonghua123 commented 2 years ago

I replaced wsl.exe with %LOCALAPPDATA%\Microsoft\WindowsApps\wsl.exe in terminal settings. see https://github.com/microsoft/WSL/issues/5408#issuecomment-994304255.

xmine64 commented 2 years ago

@liudonghua123 This is not a solution, it's a workaround. Here we have two bugs, one doesn't show the correct error code and another doesn't start wsl when you run C:\Windows\System32\wsl.exe.

hyoretsu commented 2 years ago

This happened to me after I had to force shutdown my PC. wsl -l -v works, but starting it doesn't. I had changed WindowsApps owner, but changed it back to no avail. Stock WSL works, the one that hands is the Preview.

{Application Error}
The application was unable to start correctly (0x%lx). Click OK to close the application.

[process exited with code 4294967295]

EDIT: I had to follow the fix to a T (making sure that each step worked correctly, I had a single file still under my account's ownership)

xmine64 commented 2 years ago

@hyoretsu You shouldn't touch WindowsApps if you have not done anything to it before

hyoretsu commented 2 years ago

@minusium I had messed with it precisely because I was trying to fix a pior WSL issue (a 0xc0070005 error that I couldn't find anywhere)

MatthewL246 commented 2 years ago

I'm glad I could help with my tutorial. 😀

One thing I noticed in my testing is that if you made multiple modifications to the WindowsApps folder, such as giving everyone in the Administrators group access, you will need to revert all of the changes. Unfortunately, it can get very complicated with the various Account Unknown S-1-15-3-1024-(numbers) accounts, and apparently, the permissions have to be perfect for WSL to work.

I can only recommend not touching the WindowsApps folder if the tutorial does not work and using the alternate PATH workaround so that at least running wsl.exe can work.

Also, I have noticed that WSL now outputs The application was unable to start correctly (0x%lx). This appears to be a completely unrelated issue in the string formatter.

MatthewL246 commented 2 years ago

I found another workaround for this problem!

If you go to your Windows app settings and move the Windows Subsystem for Linux Preview app from your system drive to an external drive, this problem disappears. I suspect this is because my external drive's WindowsApps folder has never been modified, so the security permissions are correct.

If you have modified your external drive's WindowsApps folder, this trick might not work, but you can try creating another NTFS partition on your drive, assigning a new drive letter, and moving the WSL Preview app to that new partition. That should create a new WindowsApps folder on that partition with correct permissions.

Note that you will need to keep this drive connected to your computer whenever you want to use WSL, or WSL will fail to start.

MatthewL246 commented 2 years ago

A bit of an update on this issue: WSL Preview version 0.56.2.0 will still fail to start if the security permissions for WindowsApps are not perfect. However, due to a recent update, it is now impossible to move WSL Preview to an external drive, breaking the previous workaround. This means that you will have to use the PATH tweak workaround if you are unable to revert all of the WindowsApps permission changes.

zstg commented 2 years ago

Here is a simple tutorial for the fix:

  1. Make sure that File Explorer is set to show hidden and system files.
  2. Open File Explorer to C:\Program Files\
  3. Right-click WindowsApps and open properties, then open the advanced security options.
  4. Remove any specific user accounts (usually with Full Control) from the list and click Apply.
  5. Click "Change" next to the "Owner:" line and accept the UAC dialog.
  6. Paste NT SERVICE\TrustedInstaller into the box, then click "Check Names" and OK.
  7. Check the box next to "Replace owner on subcontianers and objects" and click OK.
  8. In an elevated PowerShell window, run Remove-AppxPackage (get-appxpackage MicrosoftCorporationII.WindowsSubsystemforLinux -Allusers) -AllUsers
  9. Reinstall the WSL Preview app from the Microsoft Store here.
  10. To check the permissions, run get-acl "C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemforLinux_0.48.2.0_x64__8wekyb3d8bbwe\wsl.exe" | Format-List and make sure that it is owned by NT SERVICE\TrustedInstaller and that your user account does not have access.

@MatthewL246 even this doesn't seem to work for me :( I also tried moving the WSL Store executable to and from my D:\ drive - but to no avail

image Even after modifying the PATH variables and restarting it looks like the System32 wsl gets preference ..?

Still getting the same error

Is C:\Users\DELL\AppData\Local\Microsoft\WindowsApps\wsl.exe a symlink for the current version of WSL (C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemforLinux_0.56.2.0_x64_8wekyb3d8bbwe\wsl.exe) ??

image

I have a C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemforLinux_0.56.2.0_neutral_~_8wekyb3d8bbwe\wsl.exe and a C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemforLinux_0.56.2.0_x64_8wekyb3d8bbwe\wsl.exe - this is normal right?

MatthewL246 commented 2 years ago

I'm not 100% sure how to fix that @zstg, but here are some ideas. The only workaround I know of right now (if the permissions fix doesn't work) is the PATH tweak, as Microsoft no longer allows the app to be moved to another drive after an update.

Even after modifying the PATH variables and restarting it looks like the System32 wsl gets preference ...?

Did you modify the System PATH variable like this so that your WindowsApps folder is on top? I believe that the System PATH always takes precedence before the User PATH, and the order of entries does matter.

image

Please note: I have not tested this on a system with multiple users. I do not know what sort of problems adding a user-specific path to the system environment variables can cause.

Is C:\Users\DELL\AppData\Local\Microsoft\WindowsApps\wsl.exe a symlink for the current version of WSL (C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemforLinux_0.56.2.0_x64_8wekyb3d8bbwe\wsl.exe) ??

Yeah, it looks like a symlink, but I'm not 100% sure which WSL it links to.

I have a C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemforLinux_0.56.2.0neutral~_8wekyb3d8bbwe\wsl.exe and a C:\Program Files\WindowsApps\MicrosoftCorporationII.WindowsSubsystemforLinux_0.56.2.0_x64_8wekyb3d8bbwe\wsl.exe - this is normal right?

It is just like that for me as well, so I guess that's normal for Store apps.

Finally: if all of this fails, you can just uninstall the WSL preview Store app. You won't be able to use newer WSL features, but at least WSL will be functional.

zstg commented 2 years ago

My PATH does indeed have the WindowsApps folder at the top

No problem, thanks a lot!!

MatthewL246 commented 2 years ago

Update: as far as I can tell, this issue has been completely fixed! Edit: Looks like this was just a change with my environment, not an actual fix.

I decided to disable the workaround today for no particular reason, and all of my WSL distributions are now fully working. I'm not sure which update fixed this problem because I kept the workaround enabled for a while, but it must have been some update between 0.56.2.0 and 0.60.0.0.

If anyone else would like to confirm that the problem is solved, I will close this issue.

WtfJoke commented 2 years ago

@MatthewL246 I still experience the issue with wsl 0.60.0.0

Havent tried the workarounds yet. But for me the error does not happen when I open the WSL Tab in Windows Terminal, but only then. Each other way to start WSL will crash with the mentioned error.

EDIT: The workaround with resetting owner of Windows Apps+ reinstall helps (worth adding that no data is lost on ubuntu, I was scared to try first) :D

MatthewL246 commented 2 years ago

@WtfJoke I'm glad the workaround worked for you!

However, it's unfortunate that the issue wasn't fully fixed upstream; my computer just somehow magically fixed my environment. I assume that in my case some Windows or Microsoft Store update just reset the permissions correctly, and now I am able to use WSL Preview without any problems or workarounds.