Rust panic in system-configuration crate when SCDynamicStoreCreate returns NULL (sandboxed environments)
Resolved 💬 1 comment Opened Mar 24, 2026 by yulonglin Closed Mar 24, 2026
Bug Description
codex exec crashes with a Rust panic before executing any command when run inside a sandboxed environment (e.g., Claude Code's sandbox) that blocks access to macOS's configd daemon:
thread 'main' panicked at system-configuration-0.6.1/src/dynamic_store.rs:154:1:
Attempted to create a NULL object.
Environment
- macOS Darwin 25.3.0 (arm64)
- codex-cli 0.116.0
- Binary:
~/.npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/codex/codex
Reproduction
Run codex exec in any environment that restricts unix socket access to configd:
# Works fine (no network initialization):
codex --version
# Crashes:
codex exec --full-auto "echo hello"
Root Cause
codex execinitializes its Rust HTTP client- The HTTP client (likely
reqwestviahickory-dns) uses thesystem-configurationcrate (v0.6.1) to read macOS DNS resolver config SCDynamicStoreCreateconnects toconfigdvia unix socket- In sandboxed environments, the unix socket connection is blocked →
SCDynamicStoreCreatereturns NULL - The
system-configurationcrate panics on NULL instead of handling it gracefully
Expected Behavior
SCDynamicStoreCreate returning NULL should be handled gracefully — fall back to /etc/resolv.conf or system defaults rather than panicking. This is a valid runtime condition in sandboxed environments.
Workaround
Disabling the sandbox before invoking codex exec avoids the crash. But the underlying issue is that the NULL return from SCDynamicStoreCreate is not handled.
Notes
codex --versionworks because it doesn't initialize the HTTP clientRUST_BACKTRACE=fullprovides no useful info — symbols are stripped in the release binary- The binary has no codesign entitlements — this is not an entitlements issue
DNS_RESOLVER=systemenv var has no effect
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗