[Windows Desktop 26.721.3996.0] codex.exe 0xc0000409 crash triggered by Git repository detection; hiding .git prevents it
Version
- Microsoft Store package:
OpenAI.Codex_26.721.3996.0_x64__2p2nqsd0c76g0 - An earlier same-day package,
26.721.3404.0, also crashed. - The regression began immediately after the July 24 update.
- User configuration was unchanged/default.
Platform
- Windows x64
- Native local projects (not WSL)
- Exact Windows build was not collected
Summary
After the update, the native codex.exe process repeatedly hard-crashes when a local project is recognized as a Git repository. A controlled A/B test with two separate projects shows that the visibility of the .git directory deterministically changes the outcome:
.gitpresent: Codex crashes..gitrenamed so Codex cannot detect it: Codex remains usable..gitrestored: the crash returns.
This reproduced with either repository by itself, so it is not limited to multi-repository interaction.
Reproduction / controlled tests
- Close Codex completely.
- Open a local project that contains a
.gitdirectory. - Launch Codex and resume normal project use.
codex.exeexits with a native Windows crash.- Close Codex and rename
.gitto a non-Git name such as.git.codex-disabled. - Relaunch Codex and use the same project: the crashes stop.
- Restore the directory name to
.git: the crash returns.
This was tested independently on two local repositories.
Both repositories initially had zero commits, but that was ruled out as the direct cause:
- An empty initial commit was created in each repository.
git rev-list --all --countreturned1for each repository.git rev-parse --verify HEADreturned a valid commit hash for each repository.- Codex still crashed with
.gitpresent.
Therefore this is not only an unborn-HEAD / zero-commit problem. The remaining common factors include Git repository detection/watching, Japanese (non-ASCII) project paths, and repositories with no tracked files beyond an empty initial commit.
Windows Error Reporting evidence
Repeated failures on 26.721.3996.0:
Faulting application: codex.exe
Faulting module: codex.exe
Exception code: 0xc0000409
Fault offset: 0x000000000d3e12f1
Fast-fail parameter (P10): 7
The same signature occurred repeatedly at approximately 15:44, 16:46, and 17:22 local time. Windows reported the same failure bucket hash for these events.
The earlier 26.721.3404.0 package also crashed with 0xc0000409, at fault offset 0x000000000d3ee081.
Relevant app-log observations
Before applying the workaround, the logs repeatedly showed Git repository watcher activity, including:
info [git-repo-watcher] Starting git repo watcher
warning [git] git.command.complete ... subcommand=rev-parse ... exitCode=128
The rev-parse failures were observed while the repositories still had unborn HEADs. Making both HEADs valid did not prevent the native crash, so those command failures are not the sole cause.
Expected behavior
Codex should not terminate the native process when detecting or watching a valid Git repository. Any watcher, path, encoding, or repository-state error should be isolated and surfaced gracefully.
Current workaround
Rename .git so Codex does not detect the project as a Git repository. This makes the app usable again, but disables Git-aware Codex features for those projects.
Possibly related issues
- #31989 — Windows
codex.exe0xc0000409native crashes - #34473 — Windows Git scanner retry loop triggered by an unresolvable
.gitpath - #27120 — Windows Desktop exits during background Git work
This report appears distinct because the crash is reproducibly toggled by hiding/restoring .git, persists after HEAD becomes valid, and reproduces with either repository independently.
Privacy / diagnostics
Project names, user name, and local paths have been sanitized. Windows WER generated minidumps on the affected machine; they can be provided through a private channel if maintainers request them.
4 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Correction / additional observations
The original report overstated the
.gitrename as a complete workaround. Further testing showed:rev-list --all --count = 1;rev-parse --verify HEADsucceeded), but Desktop still crashed..gitchanged the behavior during the initial A/B tests, but it did not prove a complete or durable workaround; a later crash still occurred during continued use. Please treat.gitvisibility as a correlated trigger observed in the early tests, not as a confirmed root cause or guaranteed workaround.codex.exe0xc0000409failures after the 26.721 update.A separate CLI failure with an explicit large allocation error has now been filed as #35274. That CLI issue is reported separately because its failure signature differs, and no common root cause is claimed.
I am seeing a potentially related regression in a Remote SSH setup. I am adding sanitized observations because they may help distinguish the Windows Desktop crash from the remote CLI/app-server process.
Environment
0.145.0-alpha.4Behavior
codex app-serverremains alive; no OOM kill, disk exhaustion, or server-side app-server crash was observed.Server-side evidence
For PC-A, Tailscale SSH logged the Desktop proxy session ending with
context canceledat:Each exit was followed by a new Codex Remote SSH connection. The persistent remote app-server process did not restart.
The remote app-server log also contained:
This overlaps with the Remote SSH reconnect symptoms described in #23919.
Additional workspace condition
The workspace root directory was renamed recently. Some older threads still retain the previous, now-missing working directory and remote tool launches from those threads can return:
However, the Windows Desktop application exits have been observed from two different PCs, so this does not appear to be a single-machine hardware issue.
I have not renamed or hidden
.gitbecause this is a production workspace and Git-aware behavior is required. I can provide sanitized server logs and Windows Reliability Monitor details after collecting the Desktop package version and exception code.Stronger thread-specific finding
Further use narrowed the Desktop crash substantially.
codex.exeprocess to grow to approximately 17.2 GB in Windows Task Manager, while total system memory reached 97%.The local thread ID is intentionally redacted from this public report.
This makes the current leading hypothesis excessive memory use while restoring/hydrating a large image-heavy thread, rather than Git repository detection being the primary cause. The earlier
.gitobservations should be treated only as an initial correlation.This is observational evidence from one affected thread, not yet a controlled reproduction on a newly created thread. The related CLI allocation failure remains tracked separately in #35274.