openai / openai/codex

apply_patch "Update"/"Delete" always fails on Windows Desktop: fs sandbox helper stack overflow (0xC0000005 in essctl.dll); "Add" works

Open
#38,386 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug sandbox tool-calls windows-os
Dominant language
Rust
Stars
125k
Forks
19.5k
PR merge metrics
PR metrics pending

Description

apply_patch "Update"/"Delete" always fails on Windows Desktop: fs sandbox helper stack overflow (0xC0000005 in essctl.dll); "Add" works

Describe the bug

On Codex Desktop for Windows (version 26.803.10989.0), apply_patch operations that modify or delete an existing file fail deterministically before applying anything. The tool reports that the filesystem sandbox helper crashed with a stack overflow:

apply_patch verification failed: Failed to read <file>: fs sandbox helper failed with status exit code: 0xc0000005: thread '<unknown>' (PID) has overflowed its stack

Creating a new file with apply_patch works fine.

To Reproduce

  1. In a Codex Desktop session on Windows, use apply_patch to create a small text file (e.g. work/foo.txt with two short lines). This succeeds.
  2. Use apply_patch to change one line of that file. This fails with the message above.
  3. Use apply_patch to delete that file. This fails with the same message.
  4. Create another new file with apply_patch. This succeeds again.

The failure is independent of file size or content (reproduced with a two-line ASCII file). It is not caused by long lines, Unicode, or patch syntax.

Expected behavior

Update and Delete should apply like Add does.

Environment

  • Codex Desktop version: 26.803.10989.0 (Windows, ChatGPT sign-in)
  • OS: Windows 10 Pro 22H2 (10.0.19045), 64-bit
  • Session type: projectless chat under the user Documents\Codex folder

Additional context

  • Windows Application Event Log shows repeated codex.exe crashes with exception code 0xC0000005 in essctl.dll (offsets 0x102ab / 0x22db6), timestamped exactly when apply_patch fails.
  • The same helper crash occurs for Update and Delete on any existing file; Add does not trigger it, which suggests the crash happens when the helper reads an existing file during verification.
  • Local Codex log (target codex_core::tools::router) records: apply_patch verification failed: Failed to read ...: fs sandbox helper failed with status exit code: ... has overflowed its stack.
  • Workaround used: delete the file with a shell command, then re-create it with apply_patch (the Add path still works). This only works for scratch files; normal in-repo edits are blocked.

Related issues

  • #29178 (fs-helper fails when global proxy env is set) - different failure mode
  • #29072 (codex-windows-sandbox-setup.exe cannot launch from package path) - different failure mode
  • #14211 / #13965 (Windows sandbox child-process launch path) - possibly related underlying sandbox path

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the apply_patch verification path and the codex_core::tools::router log entry, then trace the Windows filesystem sandbox helper involved in reading existing files. Use the reproduction steps and Windows Application Event Log crash details to compare Update and Delete with Add. Done means existing-file updates and deletions apply successfully without the helper crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems, security, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.