Repository navigation
Description
Windows Version
Microsoft Windows [Version 10.0.22631.6199]
WSL Version
2.7.10.0
Are you using WSL 1 or WSL 2?
- WSL 2
- WSL 1
Kernel Version
6.18.33.2-2
Distro Version
Ubuntu 22.04
Other Software
Codex CLI 0.144.5
Codex is installed as a native Linux standalone binary:
/home/acrobot/.codex/packages/standalone/releases/0.144.5-x86_64-unknown-linux-musl/bin/codex
The Codex executable, ~/.codex state directory and project are all on WSL’s native ext4 filesystem. Nothing involved in the reproduction is stored under /mnt/c.
The project was located at:
/home/acrobot/tripptic
Repro Steps
- Start Codex CLI from a project stored under
/homeon the WSL ext4 filesystem. - Use Codex normally in an interactive session.
- Eventually, the Codex terminal interface freezes completely.
- Open another WSL terminal.
- Run
ps aux. It hangs while enumerating processes around the Codex process. - Running
psunderstracealso hangs inside process inspection. - Ctrl+C, Ctrl+Q and attempts to terminate Codex do not recover the process.
- Use SysRq w and t to capture blocked-task and complete task dumps.
This has occurred multiple times, although I do not yet have a deterministic minimum-duration reproduction.
Expected Behavior
Codex should remain responsive. If Codex itself deadlocks, it should remain possible to inspect and terminate it without affecting ps or other process-inspection tools.
Actual Behavior
Codex freezes, process inspection involving Codex hangs, and multiple Codex threads enter uninterruptible D state.
The SysRq dump shows a sqlx-sqlite-worker thread blocked during munmap():
task:sqlx-sqlite-wor state:D
__vma_start_write
__split_vma
vms_gather_munmap_vmas
do_vmi_align_munmap
do_vmi_munmap
__vm_munmap
__x64_sys_munmap
Another Codex tokio-rt-worker is blocked acquiring the virtual-memory write semaphore:
task:tokio-rt-worker state:D
rwsem_down_write_slowpath
down_write_killable
__vm_munmap
__x64_sys_munmap
After attempting to terminate Codex, other Codex threads become blocked while exiting:
rwsem_down_read_slowpath
down_read
do_exit
do_group_exit
get_signal
The affected threads cannot be terminated with signals because they remain in D state. Restarting the affected WSL distribution is required.
At the time of capture, PSI reported no current memory or I/O pressure:
memory some avg10=0.00 avg60=0.00 avg300=0.00
memory full avg10=0.00 avg60=0.00 avg300=0.00
io some avg10=0.00 avg60=0.00 avg300=0.00
io full avg10=0.00 avg60=0.00 avg300=0.00
The issue is not caused by DrvFS or a project under /mnt/c; the executable, project and Codex databases are all on ext4.
I have not yet reproduced the VMA stall using a program other than Codex. Codex appears to be the reproducible userspace trigger, but the unrecoverable D state and process-wide virtual-memory locking stall appear to occur in the WSL kernel.
Activity
Acrobot commentedon Jul 18, 2026
codex-freeze-environment.txt
codex-freeze-full.txt
codex-freeze-relevant.txt
codex-freeze-sysrq-w.txt
github-actions commentedon Jul 18, 2026
Diagnostic information
Acrobot commentedon Jul 24, 2026
As a note, this seems to be happening less now after I updated my BIOS. I think my i9-13900 might be unfortunately faulty (Intel acknowledged that these CPUs have a flaw in them). So please keep this in mind when researching the issue.
ClaudioIacovelli commentedon Aug 2, 2026
Independent reproducer, different userspace program, identical backtrace.
Triggered by Julia 1.11 (
julia -t 4) running ITensors.jl DMRG with threaded block-sparse contraction. Multi-GB working set, frequent allocation/free of large arrays, so the GC issues many large munmap() calls. No Codex, no Rust, no sqlite. Everything on ext4 inside the VM.Environment:
Backtrace via hung-task detector (kernel.hung_task_timeout_secs=120):
ORIG_RAX=0xb (munmap), RSI=0x059a1000 — a 94 MB region.
Thread states of the stuck process:
Matches #41113 exactly: PSI zero (15 GiB of 19 GiB free, swap 0 B, /proc/pressure/memory all 0.00, io avg60=0.01), no OOM, no ext4 errors,
unkillable by SIGKILL, only
wsl --shutdownrecovers. Reads of /proc//cmdline, syscall, wchan and maps also block permanently (mmap_lock); /proc//stat stays readable.Reproduced twice in one session (PIDs 456 and 675), 30 min to several hours in, always during GC. Not yet reproduced single-threaded, which is consistent with the per-VMA lock needing concurrent readers to contend.
Also worth noting: I hit the same class of stall on kernel 5.15.167.4 /WSL 2.4.13.0, where the signature was
rwsem_rather thanvma_start_writejpopillion commentedon Aug 19, 2026
I'm running into the exact same issue which started about 1 1/2 months ago. Cannot complete a build without a hang. Had Dicker support look at diagnostics and validated the same problem as stated here with WSL. One point of interest. I believe it started after windows update which updated my bios. I have the same scripts running perfectly on two other machines both windows but those did not have a bios update. If I reinstall the bios I am able to completely a build but the problem comes back.
Also, ran the same scripts under Hyper-V. It works without stalling or hanging but Hyper-V does not support NVIDIA Cuda gpu processing so I'm back to WSL2.
dark2momo commentedon Aug 24, 2026
Cross-version observation after switching the active WSL kernel:
After repeated unrecoverable stalls on the bundled
6.18.33.2kernel, I explicitly configured WSL through.wslconfigto boot a custom Microsoft WSL kernel:10.0.22631.46022.7.12.0uname -r:6.6.87.2-microsoft-standard-WSL2c35e3141ea3ab9c43ceada29d18d939f0da84cb11a68c6e1be62a4bc2ad199f0wsl --versioncontinued to display the 6.18 kernel bundled with the WSL package, but that was not the running kernel;uname -rand the.wslconfig kernel=...override both confirmed 6.6.87.2. No BIOS or hardware changes were made during this observation period.On 2026-08-20, the failure recurred once on the active 6.6.87.2 kernel. Before terminating the VM, a stat-only
/procscan showed Herdr PID 1880 with 82 threads, 7 in uninterruptible D state:The other 75 threads were sleeping, primarily in futex, wait, and poll paths. A Herdr client request did not return within 10 seconds. The D-state threads could not be recovered with signals, so I killed the exact HCS WSL VM. After restart, the same 6.6 kernel and same Herdr binary restored all seven workspaces, and a stat-only scan showed no D-state tasks.
As of 2026-08-24, with the same 6.6 kernel, BIOS, hardware, and workload, I have not observed another recurrence.
The single 6.6 recurrence means that switching from 6.18 to 6.6 did not completely eliminate the problem. The subsequent stable period is still too short to claim that 6.6 fixes or reduces the failure rate. I also do not have a full kernel stack for the 6.6 occurrence, and its top-level
wchansymbols differ from the__vma_start_write/munmapcapture in this issue. This should therefore be treated as a factual cross-version observation, not proof of an identical root cause. If it recurs, I will try to capture SysRq blocked-task stacks before recovery.Herdr-side tracking and userspace mitigation scope:
herdrdev/herdr#2179 (comment)
That PR avoids remote-memory-backed procfs reads when process discovery encounters an already-wedged task. It is linked here as the concrete userspace workload and defensive mitigation; it is not claimed to fix the underlying WSL D-state failure.
Cn8001 commentedon Aug 25, 2026
I'm seeing what looks like the same issue on WSL2 with:
Linux 6.18.33.2-microsoft-standard-WSL2CPU:
Intel Core i9-14900KSThe problem appeared while running a 3-broker Kafka 4.3.1 cluster in Docker. One Kafka container became impossible to stop/remove. Docker reported:
Restarting
dockerdandcontainerddid not recover it. Even:had no effect.
Docker continued reporting the container as running, with the JVM process in:
Most JVM/Kafka threads were stuck in:
For example:
Its kernel stack is:
Kernel:
The behavior looks like the JVM is already exiting, but one thread becomes stuck in the VMA/mmap path and prevents the process from completing teardown. Because the task remains in uninterruptible
Dstate, neither Docker/containerd norSIGKILLcan actually clean it up.Nijat816 commentedon Aug 26, 2026
Another reproduction — with what may be a fast, reliable reproducer (15 s – 2 min to deadlock), plus the CPU/microcode data requested in #41191.
Environment
mcupdate_GenuineIntel.dll) carries no 06-b7 entries at all, so the 9 later official revisions (0x122→0x137, incl. the 0x12B/0x12F stability updates) are all absent on this machine.cpumcupdateevent 40 "Failed to update microcode on one or more CPUs" logs on every boot..wslconfig) during July–August, with different wchans (below)Signature (identical to OP): process enters uninterruptible D-state at
wchan=__vma_start_write, SIGKILL has no effect; anything that touches its/proc/<pid>/cmdline(ps / pgrep / VS Code Server process enumeration) chains into D-state at__access_remote_vm; load climbs while all PSI stay zero. Onlywsl --shutdownrecovers.Reproducer — h5py + LZF compressed write/read loop, ~41 MB per round:
On this machine this deadlocks within 15 s – 2 min (5/5 attempts across two days, including 15 s after a fresh boot). Ordinary workloads trigger it too: conda's shell hook at terminal startup (deadlocked 108 s after boot), a plain
curldownload (stuck 60 min in__vma_start_write), python scripts.Two observations that may matter
__vma_start_writeand the rest infutex_do_wait— no thread of the process holds the VMA read lock, and no external process was accessing its mm at the time. It looks likevm_refcntnever reachestgt_refcntalthough no reader is present.dup_mmap(VS Code node during fork),__split_vma(netCDF subsetting),vma_expand(tectonic/LaTeX, python),do_vmi_align_munmap. So on this platform the problem predates the refcount rewrite — 6.18 is just much easier to trigger.We also hit #41191's
fs/namei.c:844(try_to_unlazy) panic 4× on 6.18.33.2 (plus oneerror_entrypanic, Comm=python3.12) and never on 6.6 — consistent with observations there. Additionally, a userspace probe on this machine intermittently observes non-deterministic zlib compression output (same input, three compress calls, byte-different results in bursts) on both 6.6.87.2 and 6.18.33.2, before and after the Windows upgrade — consistent with silent memory-state corruption rather than a VFS- or mm-specific bug.Happy to run a KASAN build of
linux-msft-wsl-6.18.35.2with this reproducer if useful (cc Mitchell Levy (@chessturo)).dark2momo commentedon Sep 19, 2026
Follow-up to my August observation: the subsequent stable period did not persist. Failures have continued on the pinned 6.6.87.2 kernel. I now have additional kernel-log evidence, but cannot establish that all of the following symptoms share the original issue's root cause.
Environment (checked September 19)
uname -r: 6.6.87.2-microsoft-standard-WSL2, selected through.wslconfig kernel=...wsl --versionreports bundled kernel 6.18.33.2-2, which is not the active kernelhostAddressLoopback=true,vmIdleTimeout=-1,instanceIdleTimeout=-1The following observations do not establish a BIOS or hardware cause. Hardware stability and BIOS/microcode state remain unverified in this investigation.
Observations (timestamps UTC+08:00)
September 4 and 6: contemporaneous recovery notes recorded Herdr queries timing out and D-state waits including
do_brk_flags,lock_mm_and_find_vma,vm_mmap_pgoff, and__access_remote_vm(also affecting Node/ps). These are recorded wchan observations, not full lock-owner traces.September 11, 18:52–18:53: a preserved kernel journal excerpt contains:
These lines are abridged to omit addresses/identifiers. The warnings identify kernel 6.6.87.2. The bad-page-map stack includes
print_bad_pte -> vm_normal_page -> unmap_page_range -> unmap_vmas -> exit_mmap -> __mmput -> do_exit. The RCU-warning stack includes__schedule -> schedule -> io_schedule -> folio_wait_bit_common -> filemap_get_pages -> filemap_read -> generic_file_read_iter -> ext4_file_read_iter -> vfs_read. Later taint flags include B and W.September 15 and 19: saved kernel tails again show preemption warnings in
sha256sum,herdr, anddpkg-querycontexts, including__this_cpu_add/read. The task name is execution context, not proof that that application caused the problem.September 19 at 20:55: WSL process startup failed before the intended guest probes could execute:
This was broader than a Herdr client failure. Restart restored basic guest reads and Windows mount access. Separately, on September 7, only /mnt/c had returned EIO while the Linux root remained readable. I am not assuming these two I/O incidents are the same defect.
September 19 at 22:37: Herdr again reported
Resource temporarily unavailable (os error 11).wsl --shutdowndid not finish within 20 seconds, and HCS still listed the VM as Running. We terminated that specific VM to restore availability. Other recovery attempts did shut down normally. Recovery times are not necessarily failure-onset times.Scope and evidence limitations
kernel.hung_task_timeout_secs=120has been enabled since September 9, without enabling panic.The Herdr defensive mitigation is tracked in the now-merged herdrdev/herdr#2179; it was never intended as a fix for the underlying guest failure.
Would a default/storage-profile WSL trace plus guest blocked-task stacks be the most useful next capture, or would you prefer a separate issue for the bad-page-map/preemption/I/O evidence? I can provide the retained kernel excerpts after privacy review and perform a bounded, maintainer-directed reproduction in a maintenance window.
pellorao commentedon Oct 17, 2026
Additional observations on the newer running kernel
6.18.54.1-microsoft-standard-WSL2, captured on 2026-10-17. This is additional version/call-path evidence for the VMA stall family; I have not established an identical root cause. The mmap path closely matches the Kafka/JVM stack already posted in this issue. Related: #41708.Environment: WSL 2; Windows build: 10.0.26300.9711; WSL package version: 3.0.3.0 (bundled kernel 6.18.54.1-1; WSLg 1.0.79); distro: Ubuntu 26.04.1 LTS (current installed release). Current affected runtime: Node.js; the installed Node reports v24.20.0 in a later check, but that version/executable hash was not independently bound to the hung process. Earlier occurrence: CPython 3.14.8 (python-build-standalone), on the same kernel version but a different guest boot. Read-only host queries report an Intel Core i9-14900K and BIOS version 1836; current CPU/memory stability has not been established.
Thread IDs have been replaced with descriptive labels; kernel symbols and offsets are unchanged. All stacks below are complete as returned by the saved per-thread stack files, not complete native userspace backtraces.
Current occurrence, main thread, D state:
The current Node occurrence was in a post-processing reader after a separate Python producer had completed and exited zero. That reader was intended to read a roughly 330 MiB JSON record and extract its output using an in-memory SQLite query, but there are no internal stage markers or native userspace backtrace to establish which allocation or library call it reached. Subsequent independent low-memory streaming checks of both saved serialized results and the read-only database payload matched the full reference output and the independently checked date/count relations; the producer was not rerun. Thus this particular stall does not itself demonstrate a wrong saved result.
The main thread was already in D at
__vma_start_writebefore the supervisor sent SIGTERM. Full stacks were captured about ten minutes later; SIGKILL/TERM were pending in a saved status snapshot. At stack capture, all six companions were in signal-driven group exit, so these stacks do not establish their paths before termination or identify a reader holding the VMA reference.Workers A and F (two independently saved stacks, byte-identical):
Workers B through E (four independently saved stacks, byte-identical):
Earlier occurrence, different guest boot, Python main thread, D state:
Its saved companion stack was identical to the workers B–E stack above. This occurrence happened while a large JSON encoding call had not returned; the user-space native allocation call chain and mremap arguments were not obtained. A previous targeted read of that process's syscall procfs file also blocked, so I am not repeating it.
The matching Microsoft kernel tag's mm/mmap_lock.c explains the per-VMA writer wait in terms of draining VMA reader references. No actual VMA/refcount/reader identity or closed lock dependency cycle was captured. I therefore cannot confirm a leaked reference, a specific lock owner, a permanent deadlock, or a kernel-versus-hardware cause. The saved guest kernel log had no relevant OOM, bad-page or oops entry; that absence does not exclude such causes.
An intermittent silent numeric mismatch was also saved locally, but it has no established causal link to either stall. I am keeping it separate rather than attributing it to this kernel path. No private input data, database, full application output, boot UUID, namespace identifier, host name, user path, or process-memory dump is included here. No deterministic minimal reproducer or Windows-side WSL ETL trace spanning onset is available in this candidate.
dark2momo commentedon Oct 25, 2026
Follow-up to my earlier cross-version and bad-page-map reports: a later run on WSL 3.0.3.0 / 6.18.54.1-microsoft-standard-WSL2, Ubuntu 22.04 ended in a captured kernel panic, not just an unresponsive application. This is a different failure signature from the original VMA wait; I have not established a common root cause.
Timeline (UTC+08:00, October 25–26, 2026)
BUG: Bad page map in process tokio-rt-worker pte:100f682570, followed byBUG: Bad rss-counter state ... type:MM_FILEPAGES val:1. The stack includesvm_normal_page -> unmap_page_range -> unmap_vmas -> exit_mmap -> __mmput -> do_exit. A later Codex crash at 21:19 was already markedTainted: [B]=BAD_PAGE.libcudnn_engines_precompiled.so.9andlibcublasLt.so.12. These could have independent userspace/library causes; chronology does not establish that the bad PTE caused them.kernel-panic-*.txtfor the matching VM. Its final lines include:The captured call trace (selected frames, original ordering from callee toward caller):
The Windows-captured text starts at
Call Trace, so the initial exception description and task identity are missing. I cannot identify the caller from this fragment alone. The guest journal had earliermini_init: drop_caches: 3entries;.wslconfighas no explicitautoMemoryReclaimoverride. Cache reclamation is the observed panic path, not proof that reclamation caused the initial corruption. I have not yet tested disabling automatic reclamation and am not presenting that as a confirmed workaround.Important confounders
Would you prefer this
clear_inodepanic as a separate issue, and which capture would help distinguish an inode/cache-reclaim defect from pre-existing memory corruption? I can supply the retained stack excerpt and follow a bounded diagnostic procedure. Related userspace defensive mitigation: herdrdev/herdr#2179 (not claimed to fix this kernel panic).