Windows: Godot 4.7.1 crashes with memory access error when launched by Codex sandbox, but works in normal PowerShell
What version of the Codex App are you using (From “About Codex” dialog)?
26.805.11740
What subscription do you have?
ChatGPT Plus
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
When Codex launches Godot 4.7.1 headlessly on Windows, the Godot process intermittently crashes with a Windows "Application Error" dialog.
Example:
Godot_v4.7.1-stable_win64.exe - Application Error The instruction at 0x00007FF7... referenced memory at 0x0000000000000058. The memory could not be read. Click on OK to terminate the program.
<img width="874" height="487" alt="Image" src="https://github.com/user-attachments/assets/f0d27b53-8f0e-4acd-9724-d8281ff3f094" />
I have reproduced this with both:
Godot_v4.7.1-stable_win64.exeGodot_v4.7.1-stable_win64_console.exe
The failures occur when Codex launches Godot for project validation.
Godot also reports sandbox related errors when launched by Codex:
Could not open 'user://' directory- inability to save
editor_settings-4.7.tres - failure to read the Windows certificate store
The same Godot headless editor command completes normally when I run it manually from a PowerShell session outside Codex.
What steps can reproduce the bug?
- Use the Codex app on Windows with a Godot 4.7.1 project.
- Ask Codex to make changes to the project and validate them by launching Godot headlessly.
- Codex runs a command equivalent to:
Godot_v4.7.1-stable_win64.exe --headless --editor --path . --quit
I have also seen the issue when Codex runs:
Godot_v4.7.1-stable_win64_console.exe --headless --path . --quit-after 2
- Intermittently, Windows displays a native application error dialog for the Godot executable saying that memory could not be read.
One observed invalid memory address was:
0x0000000000000058
The dialog is similar to:
Godot_v4.7.1-stable_win64.exe - Application Error
The instruction at 0x... referenced memory at
0x0000000000000058. The memory could not be read.
Click on OK to terminate the program.
- Run the equivalent Godot command manually from a normal PowerShell session outside Codex:
& "C:\path\to\Godot_v4.7.1-stable_win64.exe" `
--headless `
--path "C:\path\to\project" `
--editor `
--quit
- Outside Codex, Godot successfully initializes the project and editor:
Godot Engine v4.7.1.stable.official.a13da4feb
[ 0% ] first_scan_filesystem | Started Project initialization
...
[ DONE ] first_scan_filesystem
[ 0% ] loading_editor_layout | Started Loading editor
...
[ DONE ] loading_editor_layout
No memory-access dialog appears when running the command manually outside Codex.
- I also tested Codex with the following Windows configuration:
[windows]
sandbox_private_desktop = false
The Godot memory-access crash still occurred, so disabling the private desktop did not resolve the problem.
The issue therefore appears to depend on Godot being launched from the Codex Windows execution environment rather than the Godot project or command itself.
What is the expected behavior?
Godot should be able to execute headlessly from Codex without crashing.
Particularly:
Godot_v4.7.1-stable_win64.exe --headless --editor --path . --quit
inside Codex should behave the same as running the same command from a PowerShell session.
If the Codex sandbox does not permit the operation, Codex should return a normal sandbox or permission error rather than causing the child process to terminate with a native Windows memory-access violation.
Additional information
Godot version:
Godot Engine v4.7.1.stable.official.a13da4feb
The problem appears specific to Godot being launched from Codex. The same headless editor invocation works from a normal PowerShell session outside Codex.
I initially suspected a RAM issue or a Godot project error, but the command is reproducibly able to initialize successfully outside Codex.
When launched by Codex, Godot has also produced environment/access-related errors involving:
user://- editor settings
- the Windows certificate store
I also tested the following Codex Windows configuration:
[windows]
sandbox_private_desktop = false
The memory-access crash still occurred, so disabling the private desktop did not resolve the issue.
I am using Codex to edit a Godot project and run headless validation commands.
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
#37796 looks potentially related, but I think this issue is worth keeping separate for now because the affected child process here is Godot rather than Git.
In my case, both
Godot_v4.7.1-stable_win64.exeandGodot_v4.7.1-stable_win64_console.execan show the native Windows "memory could not be read" crash when launched by Codex, while the same headless Godot invocation works from a normal PowerShell session outside Codex.If both issues share the same underlying Windows command-runner/sandbox cause, this may provide another reproduction using a non-Git executable. Happy for maintainers to merge/close this as a duplicate if they confirm they have the same root cause.