WSL2: every process launch fails with Wsl/Service/RPC_S_SYSTEM_HANDLE_TYPE_MISMATCH (0x8007072c) on 26300.9711/.9818, AMD; WSL1 works
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 22/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- cpp, linux
- Ambito
- operating-systems
Direzione di ricerca
Start with the WSL service events and collect-wsl-logs.ps1 trace attached to the report, then follow the WSL2 CreateLxProcess result unmarshalling for the five sh_socket handles. Compare that path with WSL1’s sh_file handles and the related report in #42077. The failure is reproduced by importing the Alpine 3.24 minirootfs and running wsl -d wsltest -- echo hi; done means WSL2 prints hi successfully.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Windows Version
Microsoft Windows [Version 10.0.26300.9818] (Windows 11 Enterprise 26H2, after KB5127936). Also reproduced on 10.0.26300.9711 (KB5127648).
WSL Version
3.0.5.0 (kernel 6.18.58.1-1). Also reproduced on 3.0.3.0 (kernel 6.18.54.1-1).
Are you using WSL 1, WSL 2, or WSLC?
- WSL 2
- WSL 1
- WSLC
Kernel Version
6.18.58.1-microsoft-standard-WSL2
Distro Version
Any: Ubuntu 22.04, Ubuntu 24.04, Ubuntu 26.04, and a plain Alpine 3.24 minirootfs imported with wsl --import. wsl --system fails the same way.
Other Software
AMD Ryzen 7 7800X3D, NVIDIA RTX 4080 SUPER (driver 621.01). VirtualMachinePlatform + Microsoft-Windows-Subsystem-Linux enabled; full Hyper-V not installed. VBS running with Credential Guard only (HVCI off).
Third-party software has been ruled out: the error persists after uninstalling Huorong, VMware Workstation and AlibabaProtect, and also in a clean boot with all 37 non-Microsoft services, 8 non-hardware third-party kernel drivers (NetFilter SDK xfilter, Xunlei XLWFP, etc.) and all startup apps disabled. The 64-bit Winsock catalog contains only Microsoft providers (no LSP). sfc /scannow and DISM /RestoreHealth report no problems.
Repro Steps
wsl --import wsltest C:\wsltest alpine-minirootfs-3.24.4-x86_64.tar.gz --version 2wsl -d wsltest -- echo hi
Expected Behavior
hi is printed.
Actual Behavior
The RPC call contains a handle that differs from the declared handle type.
Error code: Wsl/Service/RPC_S_SYSTEM_HANDLE_TYPE_MISMATCH
wsl.exe exits with -1. Every command that starts a Linux process fails this way: default shell, wsl -u root, first-run OOBE (which then reports "failed to read passwd database"), wsl --system and wsl --debug-shell. It makes no difference whether wsl.exe runs in Windows Terminal, conhost, with pipes or file redirection, with a clean environment, or elevated.
Things that still work: wsl --status, wsl -l -v, wsl --version, wsl --shutdown, wsl --import, wsl --unregister and wsl --manage ... --set-sparse.
The same distro works under WSL1. After wsl --set-version wsltest 1, wsl -d wsltest -- sh -c 'echo hi; uname -r' prints hi and 4.4.0-26100-Microsoft. Converting it back to WSL2 brings the error back.
Turning off optional features in .wslconfig changes nothing. I tried guiApplications=false, networkingMode=none, dnsTunneling=false, autoProxy=false, firewall=false, nestedVirtualization=false and safeMode=true.
What the trace shows (from collect-wsl-logs.ps1, Microsoft.Windows.Lxss.Manager events):
- The utility VM boots and mini_init runs.
LxMiniInitMessageCreateInstanceResultreturnsResult = 0.LxInitMessageInitializeResponsereports the distro (alpine 3.24.4).LxInitMessageCreateSessionand thenLxInitMessageCreateProcessUtilityVmboth succeed (the latter returns a port).- wslservice logs no error after that. wsl.exe then fails with 0x8007072c.
So the guest side and wslservice both appear to succeed. The failure seems to happen when the result of ILxssUserSession::CreateLxProcess is unmarshalled back into wsl.exe. On the WSL2 path that result carries five [out, system_handle(sh_socket)] hvsocket handles: StandardIn, StandardOut, StandardErr, CommunicationChannel and InteropSocket. On WSL1 the out handles are sh_file instead, which would explain why WSL1 works. Downgrading WSL won't help, because every 2.5.8+ / 2.6 / 2.7 / 3.0 release uses the same sh_socket marshalling.
An AF_HYPERV socket created in a normal user process on this machine looks correct: File object on \Device\Afd, XP1_IFS_HANDLES set, SIO_BASE_HANDLE returns the same handle, and the provider is the Microsoft "Hyper-V RAW" entry.
Possibly related: this machine was also affected by the AMD HcsGetServiceProperties("ProcessorCapabilities") -> ERROR_INVALID_DATA regression (#41917). That warning is gone after KB5127936 (26300.9818), but the RPC_S_SYSTEM_HANDLE_TYPE_MISMATCH error is not. The only other report of this error I could find is #42077, which was closed without logs.
Diagnostic Logs
Logs collected with collect-wsl-logs.ps1 while reproducing wsl -d wsltest -- echo hi. I will email them to [email protected] with this issue number in the subject.
- Lingua principale
- C++
- Stelle
- 34.4k
- Fork
- 1.9k
- Merge medio
- 1g 23h
- PR unite (30g)
- 166
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/WSL
-
feature wsl2
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
microsoft/WSL#42306 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
microsoft/WSL#42114 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
feature kernel wsl2
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
microsoft/WSL#41107 · 3 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
feature kernel
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
microsoft/WSL#41054 · 9 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
feature GPU
Difficoltà 1/5 1-3 ore Idoneità per principianti 70/100
microsoft/WSL#13592 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di microsoft/WSL
Issue simili
-
needs-format
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Niko1221/Strata#6251 · 1 commento ·
I maintainer di solito rispondono entro 5 giorni
-
[Bug]: NP 管理器文件编辑器里删除键无效Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
metasequoiaime/msime#11666 ·
I maintainer di solito rispondono entro 1 giorno
-
DAE2 crashes on call.without.effects with a non ref.func expressionForse già presa @stevenfontanella l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
WebAssembly/binaryen#9404 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
CodeZombie/goodluckOS#178 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
CVO-Org/immersive-cigs-rewrite#313 ·
I maintainer di solito rispondono entro 1 giorno