Skip to content

Oversized GIF in saved message queue causes startup crash loop #51818

Open

Description

@jananadiw

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

26.930.21537 and 26.1002.52244

What subscription do you have?

Pro

What platform is your computer?

  • macOS 27.0.1
  • Apple Silicon, 16 GB RAM
  • App versions: 26.930.21537 and 26.1002.52244
  • Crashes observed: October 5–7, 2026, Pacific time

What issue are you seeing?

The Codex/ChatGPT desktop app repeatedly crashed within seconds of launch.

Eight crash reports showed a consistent main-process failure. A crash dump explicitly reported “process out of memory.”

Investigation found that ~/.codex/.codex-global-state.json was approximately 360 MB. One entry under queued-follow-ups contained a GIF attachment stored as an approximately 357 MB data URL.

Steps to reproduce

The original attachment and queuing sequence has not been reproduced in a clean environment. The observed failure occurred when opening the app with the oversized GIF already persisted in the queue.

Environment

  • macOS 27.0.1
  • Apple Silicon, 16 GB RAM
  • App versions: 26.930.21537 and 26.1002.52244
  • Crashes observed: October 5–7, 2026, Pacific time

What steps can reproduce the bug?

The original attachment and queuing sequence has not been reproduced in a clean environment. The observed failure occurred when opening the app with the oversized GIF already persisted in the queue.

What is the expected behavior?

An oversized attachment should be rejected with a clear message. If it is already saved in the queue, the app should open successfully and allow the user to remove or replace it.

Additional information

Recovery and evidence

After backing up the saved state and removing only that GIF attachment, the state shrank to approximately 2.9 MB. The app opened successfully and remained running. The queued message text was preserved.

This strongly suggests the saved attachment triggered memory exhaustion during startup. The exact allocation path was not established.

Suggested improvements

  • Validate attachment size before reading or encoding.
  • Persist attachment references instead of inline payloads.
  • Recover safely from oversized saved queue entries while preserving message text.

Activity

  1. added
    app
    on Oct 7, 2026
  2. added
    bug
    on Oct 7, 2026
  3. github-actions commented on Oct 7, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  4. Cayennina commented on Oct 15, 2026

    @Cayennina

    Additional macOS case with static JPEG and PNG attachments on a newer build, with a targeted recovery recorded on October 12, 2026 (UTC+8). This adds evidence that the persisted-queue failure is not limited to GIFs.

    Environment and user impact

    • Desktop app: 26.1007.30912, build 20156, bundle ID com.openai.codex (executable/app name ChatGPT).
    • macOS 27.0.1, Apple Silicon.
    • After sending large images, the application repeatedly crashed on launch. The user reports that reinstalling the app and restarting the computer did not resolve it. Recovery ultimately required another AI application, WorkBuddy, to inspect and repair the local persisted state.
    • The details below were checked against the retained WorkBuddy command outputs, not inferred from the symptom alone.

    Persisted state and attachment evidence

    ~/.codex/.codex-global-state.json was 374,528,501 bytes and parsed successfully as JSON. One thread had one queued message under queued-follow-ups. Its context.imageAttachments contained:

    Format Dimensions Original file bytes Persisted data-URL characters
    JPEG 22678 × 22678 72,837,296 97,116,419
    PNG, 16-bit RGBA 15000 × 10000 206,988,821 275,985,118

    Both attachment records had uploadStatus=idle. The queued message accounted for approximately 373.1 MB of the saved state.

    A retained macOS crash report recorded EXC_BREAKPOINT / SIGTRAP on CrBrowserMain, with Codex Framework / V8 / Node in the stack. This case does not independently establish the exact allocation/serialization failure or an out-of-memory diagnosis.

    Targeted recovery actually performed

    1. Preserved the original global-state file as a backup and recovered the original images from its data URLs.
    2. Saved the queued message text separately.
    3. Changed only queued-follow-ups to an empty object, atomically wrote the state, and synchronized its normal .bak copy.
    4. The state shrank from approximately 374.5 MB to 1.42 MB. The app launched and remained running during the subsequent checks; the crash-report count did not increase.
    5. After recovery, 18 abandoned temporary state-write files totaling approximately 1.23 GB were moved to Trash.

    This was a targeted queue reset, not deletion of the entire Codex profile or chat-history database. The before/after result strongly implicates processing of oversized persisted attachments, although a clean-profile reproducer and exact internal cause have not been established.

    Please validate size and pixel limits before encoding/persisting attachments, avoid embedding such large payloads in global UI state, and provide a startup recovery path that lets the user remove a problematic queued attachment without losing other work. Reinstalling or rebooting should not leave the user trapped in an unrecoverable launch loop.

    Only sanitized diagnostic facts are included here; no original images, private conversation text, account identifiers, or raw state/log files are attached.

  5. yama49 commented on Oct 18, 2026

    @yama49

    Additional macOS evidence for the same oversized queued-attachment startup crash, including a Preview/HEIC copy-paste ingestion path (not a large original GIF upload).

    Environment: desktop app 26.1013.40934 build 20770, bundle com.openai.codex, macOS 26.6.2 (25G83), Apple Silicon, 64 GB RAM, Codex Framework 155.0.8059.80. Incident: October 18, 2026.

    User-reported trigger: open a normal-sized HEIC photo in macOS Preview, copy image content/selection, paste into the desktop composer, then submit. The source HEIC is only 4,285,292 bytes, 8064×4536, 10-bit Display P3. The exact clipboard handoff has not been instrumented or repeated after recovery.

    Independently verified preserved data:

    • One queued message contains context.imageAttachments[0].src as an inline PNG data URL, even though the same attachment also has a temporary localPath and uploadStatus: idle.
    • PNG: 152,794,525 bytes (145.72 MiB), 7426×4192, 16-bit RGBA / 64 bits per pixel. Its uncompressed pixel budget is 249,038,336 bytes.
    • Data URL: 203,726,058 characters (194.29 MiB). Decoding its base64 and hashing the bytes produces the same SHA-256 as the quarantined PNG on disk.
    • Preserved global-state JSON: 204,260,263 bytes. The queued image dominates the file.
    • Thumbnail inspection shows the same game-menu scene as the source photo, with different framing/tonality; this does not establish pixel-exact identity or which clipboard/native conversion stage produced the 16-bit PNG.

    Failure evidence: 15 retained macOS crash reports identify EXC_BREAKPOINT / SIGTRAP on CrBrowserMain / com.apple.main-thread. A retained direct-launch stderr explicitly reports:

    OOM error in V8: Zone Allocation failed - process out of memory
    

    The previous local diagnostic record reports these controlled comparisons: a fresh Chromium user-data directory with the affected Codex home still failed; a clean Codex home worked; a reduced copy of the affected home without oversized state worked; adding the affected global-state JSON and its backup restored the failure. I verified the preserved payload and OOM stderr, but did not rerun the destructive startup experiment during this review. The test does not distinguish the primary file from the backup individually.

    Read-only shipped-bundle inspection (installation was not patched) found a matching persistence mechanism:

    • The inspected composer attachment path calls FileReader.readAsDataURL, separately persists pasted file bytes to a codex-clipboard-* temporary file, and retains the full src alongside localPath. The size-admission closure in that particular inspected function returns true; this is not a claim that every upload path lacks limits.
    • Queued follow-ups are committed through global-state updateAndPersist.
    • That store serializes the full state with JSON.stringify, writes the main file plus .bak, and uses temporary-file/rename atomic replacement.
    • The inspected startup loader reads the whole file as UTF-8 and calls JSON.parse before per-key validation. That function has no pre-read file-size admission check. It falls back to .bak for ordinary load failures; a fatal native V8 OOM is not recoverable with an ordinary JS catch.

    Recovery: backing up/isolation of the oversized queue state and the matching temporary image restored usability. Current state is around 543 KB and the queue is empty. No app binary, global Java/Node runtime setting, or authentication configuration was changed by this review. A first cleanup reportedly recurred; there is insufficient evidence to attribute that recurrence to cloud drafts. Different partial .tmp sizes show interrupted writes, not necessarily continuous logical payload growth.

    Requested fixes: enforce byte/pixel budgets before expensive clipboard/image conversion; use file-backed attachment references rather than inline data URLs in global state; bound startup hydration and backup recovery; quarantine an oversized queued item while retaining unrelated conversations and queued text; prevent repeated full-state write amplification.

    No private photo, raw global state, raw crash dump, account information, local username/path, conversation ID, or credentials are included. This is a sanitized technical follow-up prepared with assistant help. Related Windows observations: #52912 and #51261.

  6. Shinshin124 commented on Nov 24, 2026

    @Shinshin124

    A November build adds another place to check. On my M3 Pro running 26.1120.41243, I cleared the image queue from .codex-global-state.json and verified it was empty. The desktop app still threw Peer closed MessagePort connection. Four pending messages with inline images were also present in ~/.codex/.codex-global-state.sqlite, in the settings table under global / queued-follow-ups. Removing the four pending messages from that conversation with the app fully quit let me open my original profile from the Dock again. The earlier GIF and HEIC cases here helped identify what to look for. Read-only size check and recovery details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugperformance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions