[BUG] Codex v0.118.0 causes macOS kernel panic (os_refcnt overflow) — 2 crashes in 1 day on Apple Silicon
Environment
- OS: macOS 25E246 (Sequoia)
- Chip: Apple Silicon M-series (T8132)
- Codex version: 0.118.0 (desktop app + CLI)
- Node: v24.14.0
Bug Description
Codex causes full macOS kernel panics with os_refcnt overflow. This happened twice in a single day (April 5, 2026), requiring hard reboots each time. All running services and work were interrupted.
Crash Signature
panic(cpu 9 caller 0xfffffe0044beb48c): os_refcnt: overflow
(rc=0xfffffe1f3ec31274, count=268435456, max=268435455) @refcnt.c:68
Panicked task: pid 64850: Codex
Kernel extension in backtrace:
com.apple.AppleSystemPolicy(2.0)
dependency: com.apple.driver.AppleMobileFileIntegrity(1.0.5)
dependency: com.apple.security.quarantine(4)
dependency: com.apple.security.sandbox(300.0)
Crash Details
Crash 1: PID 64850 (Codex) — os_refcnt: overflow (count=268435456, max=268435455)
Crash 2: PID 34212 (Codex) — identical crash signature, same day after updating to v0.118.0
Both crashes occurred on CPU core 9 with the same backtrace through AppleSystemPolicy.
Root Cause Analysis
Codex appears to leak file system reference counts through Apple's AppleSystemPolicy kernel extension. Each file access creates a reference via Apple's security/quarantine checks. Codex's aggressive file scanning pattern accumulates references faster than the kernel can reclaim them, eventually hitting the hard maximum of 268,435,455 and overflowing the counter.
The AppleSystemPolicy extension handles file quarantine, code signing, and Gatekeeper checks. Codex's rapid file I/O pattern triggers these checks at extreme volume without properly releasing references.
Steps to Reproduce
- Install Codex desktop app v0.118.0 on macOS Sequoia (Apple Silicon)
- Open Codex in a project directory with many files
- Let Codex scan and index the codebase
- System will kernel panic within minutes to hours
Impact
- Full system crash requiring hard reboot
- Data loss risk from unclean shutdown
- All running processes killed — no graceful shutdown possible
- This is not an app crash — it's a kernel-level failure that takes down the entire operating system
Workaround
Uninstalled Codex entirely (desktop app + CLI + all cached files). No other application on this system has ever caused a kernel panic.
Additional Notes
- Updated from an earlier version to 0.118.0 — the crash persisted after the update
- No other application on this machine (Claude Code, OpenClaw, Node.js services, Python bots) has triggered this issue
- Full panic logs from
/Library/Logs/DiagnosticReports/are available upon request - This appears to be specific to Apple Silicon + macOS Sequoia + AppleSystemPolicy interaction
8 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Reviewed both flagged issues. This is not a duplicate — it's a severity escalation of the same root cause.
syspolicyd/trustdCPU spikes — the system stays up but apps hangos_refcntcounter overflows at 268M and the kernel panics, crashing the entire machine. Twice in one day.All three issues share the same root cause: Codex's child-process execution pattern triggers excessive
AppleSystemPolicyvalidation checks. The difference is that in my case, the reference count leaked to the hard maximum and overflowed, causing a kernel-level crash rather than just CPU spikes.This issue provides the kernel panic backtrace that confirms the connection to
com.apple.AppleSystemPolicyand should help engineers understand the full severity spectrum of this bug.Keeping this open as it documents the most severe manifestation.
This sounds like a significant issue with MacOS. No user-mode app should be able to panic the kernel based on its file system access patterns.
It is constantly crashing at this point for me.
I have same problem,
Seeing the same behavior.
Codex app: Version 26.409.20454 (1462)
Codex cli: OpenAI Codex (v0.121.0)
Another data point with the same panic signature, observed on Codex Desktop 26.429.30905 (CFBundleVersion 2345).
Environment:
com.openai.codexSymptom:
Codexwas the panicked task.Relevant panic excerpt:
This looks like the same
AppleSystemPolicy/ AMFI / quarantine / sandbox path as the original report. Happy to provide additional sanitized panic details if they would help.This is a daily thing for me at this point.
We need this fixed ASAP, it is breaking workflows and remote work.