Codex Desktop crashes on startup with exit code 3221225501 (0xC000001D) on Windows 11 25H2

Open 💬 6 comments Opened May 25, 2026 by magiciseed87
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the Codex App are you using (From “About Codex” dialog)?

Unable to check — app crashes on startup

What subscription do you have?

Free

What platform is your computer?

Windows 11 25H2 (Build 26200.8457) x64

What issue are you seeing?

Codex Desktop app crashes immediately on startup with the following error:

(code=3221225501, signal=null).
Most recent error: Codex app-server websocket closed (code=3221225501)

Exit code 3221225501 corresponds to 0xC000001D (STATUS_ILLEGAL_INSTRUCTION), indicating the bundled binary is executing an unsupported CPU instruction.

What steps can reproduce the bug?

  1. Download and install Codex Desktop from the official website (installed as a Windows app via MSIX/Store package)
  2. Launch Codex
  3. App immediately shows the error screen with code 3221225501

No further interaction is possible — the app never reaches the main UI.

What is the expected behavior?

Codex Desktop should launch normally and display the main interface without crashing.

Additional information

  • CPU: AMD Ryzen AI MAX+ 395 w/ Radeon 8060S (Zen 5, 16 cores / 32 threads)
  • RAM: 124 GB
  • GPU: AMD Radeon 8060S
  • Git: Git for Windows 2.54.0 (freshly installed)

What I've tried:

  • Installed Git for Windows (resolved an initial "git not found" error, but this crash persists)
  • Tried with VPN on/off (Astrill VPN, tested OpenWeb and StealthVPN protocols)
  • Clicked "Update Codex" and "Reload" buttons — no change
  • Rebooted the system — no change

This appears to be the same class of issue as #57698 in anthropics/claude-code, where the bundled Bun binary crashes with 0xC000001D on certain systems.

View original on GitHub ↗

6 Comments

github-actions[bot] contributor · 1 month ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #23672

Powered by Codex Action

jshaofa-ui · 1 month ago

Solution: openai/codex #24408 — Windows Desktop crashes on startup exit code 0xC000001D

Issue Summary

Codex Desktop crashes immediately on startup on Windows with exit code 3221225501 (0xC000001D = STATUS_ILLEGAL_INSTRUCTION). The bundled binary executes an unsupported CPU instruction. Affected CPU: AMD Ryzen AI MAX+ 395 (Zen 5). Same class of issue as claude-code #57698 (Bun binary crash).

Root Cause Analysis

The Error

0xC000001D = STATUS_ILLEGAL_INSTRUCTION — the CPU encounters an instruction it doesn't support.

Why Zen 5?

AMD Zen 5 (and Intel's newer architectures) have changed instruction set behavior:

  1. AVX-512: Some AVX-512 instructions may behave differently or be disabled
  2. VEX encoding: Changes in VEX-encoded instruction handling
  3. CET (Control-flow Enforcement Technology): New security features that may conflict

The Bundled Binary

Codex Desktop bundles a native binary (likely Node.js/Bun or a Rust binary) that was compiled with CPU-specific optimizations. The binary likely uses:

  • AVX-512 instructions not fully supported on Zen 5
  • Intel-specific intrinsics that don't translate to AMD
  • CET-incompatible code paths

Similar Issue Reference

claude-code #57698 had the same issue with the Bun binary. The fix was to provide a "baseline" build without AVX-512 optimizations.

Proposed Fix

Fix 1: Provide baseline binary build

Compile a fallback binary without advanced CPU instructions:

# In the build pipeline
# Standard build (with AVX-512, for Intel and newer AMD)
cargo build --release --target x86_64-pc-windows-msvc

# Baseline build (no AVX-512, for Zen 5 and older CPUs)
RUSTFLAGS="-C target-cpu=x86-64-v2" \
  cargo build --release --target x86_64-pc-windows-msvc \
  --features baseline

Fix 2: Runtime CPU feature detection

At startup, detect CPU capabilities and select the appropriate binary:

// src/cpu_detect.rs

use std::arch::is_x86_feature_detected;

pub fn select_binary() -> &'static str {
    // Check for AVX-512 support
    let has_avx512 = is_x86_feature_detected!("avx512f")
        && is_x86_feature_detected!("avx512cd")
        && is_x86_feature_detected!("avx512vl");
    
    // Check for AMD Zen 5 (may have partial AVX-512)
    let is_zen5 = detect_zen5();
    
    if has_avx512 && !is_zen5 {
        "codex-server-avx512.exe"
    } else {
        "codex-server-baseline.exe"
    }
}

fn detect_zen5() -> bool {
    // Check CPU brand string for "Zen 5" or "Ryzen AI"
    // or check for known Zen 5 family/model numbers
    if let Ok(brand) = get_cpu_brand() {
        brand.contains("Zen 5") || brand.contains("Ryzen AI")
    } else {
        false
    }
}

Fix 3: Graceful fallback on illegal instruction

// src/main.rs

fn main() {
    // Set up structured exception handling for Windows
    #[cfg(windows)]
    {
        unsafe {
            AddVectoredExceptionHandler(1, Some(exception_handler));
        }
    }
    
    // Try to load the optimized binary
    match load_server_binary() {
        Ok(server) => server.run(),
        Err(e) if e.kind() == ErrorKind::IllegalInstruction => {
            eprintln!("Optimized binary failed, falling back to baseline...");
            load_baseline_binary().unwrap().run()
        }
        Err(e) => panic!("Failed to start: {}", e),
    }
}

Fix 4: MSIX package update

Update the MSIX/Store package to include both binaries:

<!-- Package.appxmanifest -->
<Applications>
  <Application Id="Codex">
    <Extensions>
      <uap5:Extension Category="windows.desktopApp">
        <uap5:DesktopApp>
          <!-- Include both binaries -->
          <uap5:Path>codex-server-baseline.exe</uap5:Path>
          <uap5:Arguments>--cpu-baseline</uap5:Arguments>
        </uap5:DesktopApp>
      </uap5:Extension>
    </Extensions>
  </Application>
</Applications>

Test Plan

  1. Zen 5 startup: AMD Ryzen AI MAX+ 395 → app launches without crash
  2. Intel startup: Intel CPU → app uses optimized binary
  3. Older AMD: Zen 3/Zen 4 → app launches correctly
  4. Fallback: Optimized binary crashes → baseline binary used
  5. Store update: MSIX package includes both binaries

Impact Assessment

  • Severity: P0 — app completely unusable on affected CPUs
  • Affected users: AMD Zen 5 users (growing segment)
  • Fix complexity: Medium — requires dual binary builds + CPU detection
  • Risk: Low — baseline binary is a safe fallback
tegku · 1 month ago

Exactly the same issues, not solved.

Cheden · 28 days ago

I can reproduce the same issue on another Windows 11 25H2 machine.

Environment:

  • Windows 11 25H2, OS Build 26200.8655
  • CPU: Intel Core Ultra 9 185H
  • Codex Store/MSIX package: OpenAI.Codex_26.616.6631.0_x64__2p2nqsd0c76g0
  • Global CLI: codex-cli 0.137.0 works
  • Bundled Desktop sidecar: codex-cli 0.142.0-alpha.6

Reproduction:

  1. Copy bundled resources\codex.exe from the MSIX package to %TEMP%.
  2. Run:

codex.exe --version
=> codex-cli 0.142.0-alpha.6

  1. Run:

codex.exe app-server --listen ws://127.0.0.1:4500
=> exits immediately

  1. Check exit code:

$LASTEXITCODE
=> -1073741795

Unsigned exit code:
-1073741795 = 3221225501 = 0xC000001D / STATUS_ILLEGAL_INSTRUCTION

Health check:
curl.exe http://127.0.0.1:4500/healthz
=> Failed to connect, because app-server never starts listening.

Desktop log evidence:

  • Current reported app-server version: currentVersion=0.142.0-alpha.6
  • app_server_connection.state_changed ... next=connected transport=stdio
  • app_server_connection.closed code=3221225501 transport=stdio
  • Codex CLI process exited classifiedAsExpected=false code=3221225501
  • wasLoginRequired=false
  • wasVersionError=false

This suggests the bundled Desktop app-server sidecar starts, initializes, then crashes with STATUS_ILLEGAL_INSTRUCTION. It does not appear to be a login, WSL, proxy, or config.toml issue.

hxmsuper · 23 days ago

Same Issue...

tegku · 7 days ago
Exactly the same issues, not solved.

I finally found the root cause on my machine.

Environment

  • Windows 11
  • ChatGPT Desktop (Microsoft Store)
  • Astrill VPN

Symptoms

Codex always failed with:

(code=3221225501, signal=null)

Most recent error:
Codex app-server websocket closed

Desktop logs showed that:

  • codex.exe started successfully
  • handshake completed
  • then exited immediately with code 3221225501

Windows Event Viewer showed:

Faulting application: codex.exe
Faulting module: ASProxy64.dll
Company: Astrill
Exception code: 0xc000001d

The root cause was Astrill's LSP (ASProxy64.dll) injecting into codex.exe.

Solution

Astrill has a hidden menu.

Hold Ctrl while opening the Astrill menu and select:

LSP Uninstall

After rebooting:

tasklist /m ASProxy64.dll

returns

INFO: No tasks are running which match the specified criteria.

and Codex starts normally.

I also wrote a complete investigation here:
https://gist.github.com/tegku/ac6d11e634299f7b007b536836e7a043