Self-exec via /proc/self/exe breaks when executable deleted

Resolved 💬 4 comments Opened Apr 23, 2026 by dcolascione Closed Apr 23, 2026

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_

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗