codex - 💡(How to fix) Fix Self-exec via /proc/self/exe breaks when executable deleted [4 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#19132Fetched 2026-04-24 06:00:18
View on GitHub
Comments
4
Participants
3
Timeline
9
Reactions
0
Timeline (top)
commented ×4labeled ×3closed ×1unlabeled ×1
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

Main

What subscription do you have?

Yes

Which model were you using?

No response

What platform is your computer?

Linux

What terminal emulator and version are you using (if applicable)?

No response

What issue are you seeing?

Codex tries to exec itself for various purposes by running the executable to which /proc/self/exe points, but when the executable is deleted (e.g. by cargo while hacking on Codex itself), the /proc/self/exe symlink points to the original path plus " (deleted)", which is unlikely to name a working codex binary.

What steps can reproduce the bug?

Delete the running codex binary, perhaps by doing a cargo build of Codex.

What is the expected behavior?

No response

Additional information

No response

extent analysis

TL;DR

The issue can be worked around by ensuring the Codex binary is not deleted while it's running, or by finding an alternative way for Codex to execute itself without relying on /proc/self/exe.

Guidance

  • Verify if the issue occurs when the Codex binary is not deleted during execution, to confirm the cause.
  • Consider using a temporary copy of the Codex binary for self-execution purposes, to avoid issues with the original binary being deleted.
  • Investigate alternative methods for Codex to execute itself, such as using a separate process or a different executable path.
  • Check if there are any existing issues or discussions related to this problem in the Codex project, for potential solutions or workarounds.

Example

No code snippet is provided due to lack of specific implementation details.

Notes

The provided information does not specify the expected behavior, which might be necessary to determine a complete solution. Additionally, the issue seems to be related to the specific way Codex handles self-execution on Linux systems.

Recommendation

Apply workaround: The issue seems to be related to the dynamic nature of the /proc/self/exe symlink, so finding a way to stabilize or alternative the execution method is likely the best approach, given the information provided.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING