Skip to content

Codex app-server leaks unified-computer-use node helper processes, exhausting per-user io_uring budget #44917

Open

Description

@nickgermaine

Environment

  • Arch Linux, kernel 7.2.3
  • ChatGPT desktop (chatgpt-desktop 26.901.51231-1)
  • Codex app-server launched by the desktop app: /usr/lib/chatgpt/resources/codex app-server
  • Plugin: openai-bundled/unified-computer-use 26.901.51231

What happens
Every Codex session spawns a pair of node processes under the app-server:
/usr/lib/chatgpt/resources/cua_node/bin/node ./server.mjs
/usr/lib/chatgpt/resources/cua_node/bin/node ~/.codex/plugins/cache/openai-bundled/unified-computer-use/26.901.51231/script
They are never terminated when the session ends. After two days I had 116 of them, all children of the single codex app-server pid, oldest from 48 hours earlier.

Why it matters
Each helper holds three io_uring instances (node/libuv). io_uring ring memory is accounted against the per-user RLIMIT_MEMLOCK budget (8 MiB default). With ~350 rings held, io_uring_setup() returns ENOMEM for every process running as my user. First visible symptom was Ghostty: new tabs and windows opened blank because its per-surface event loops could not create rings. Any other io_uring user would fail the same way.

Repro

  1. Open the ChatGPT desktop app on Linux, run several Codex sessions that use computer use.
  2. ps -eo pid,ppid,etimes,args | grep cua_node
    Count grows by two per session and never shrinks.
  3. Once enough accumulate, a trivial io_uring_setup(256, ...) from any process fails with ENOMEM.

Expected
Helper processes exit when their session ends, or the app-server reaps them on idle.

Workaround
kill the stale helpers by hand, or raise DefaultLimitMEMLOCK for the user session.

Activity

  1. added
    bug
    app
    app-server
    on Sep 11, 2026
  2. user01010111 commented on Oct 17, 2026

    @user01010111

    I reproduced the per-user io_uring allowance exhaustion on desktop 26.1007.71326, with bundled codex-cli 0.162.0-alpha.17.2. This is a community Linux repack on CachyOS, so I have not established the same result on an unmodified official distribution.

    The live snapshot contained 292 distinct queues accounting for 8,372,224 bytes against an 8,388,608-byte limit, leaving 16 KiB. Of these, 284 queues belonged to Node descendants of the desktop app-server, with another five owned by the desktop GUI. A native 200-entry queue request failed with -ENOMEM. Disposable-child tests reproduced the exact predicted page boundary without stopping workers or changing any existing application's limits.

    The resource exhaustion and ownership were verified; an unintended leak or a particular failed-cleanup path remains unproven. The full report follows. Sanitised supporting snapshots and a standalone Python reproducer are preserved locally and can be provided if useful; no attachment is included in this comment.

    Environment, process attribution, exact boundary tests and limitations
    Retained Codex tool-server processes exhaust Linux locked-memory allowance and prevent unrelated io_uring allocations
    
    Summary
    
    On a community Linux repack of Codex desktop 26.1007.71326, long-lived local tool-server processes account for almost all of an 8 MiB locked-memory allowance shared by io_uring allocations for the user. An unrelated application's io_uring_queue_init(200, ..., 0) then fails with -ENOMEM despite about 16 GiB of available RAM.
    
    I traced the live queue owners and reproduced the exact memory-accounting boundary without restarting Codex, terminating workers or changing an existing application's limits. This establishes the resource exhaustion and attribution. It does not establish that every retained worker is unintended, that the app leaks on every thread retirement, or that a particular update introduced the behaviour.
    
    Packaging scope
    
    This is a community Linux repack, not a reproduction on an unmodified official distribution. Installed metadata identifies it as "ChatGPT Community", based on upstream Linux package chatgpt 26.1007.71326 amd64. The packaged application identifies itself as Codex/openai-codex-electron 26.1007.71326. The build metadata reports unknown source provenance and no source commit.
    
    Environment
    
    - Observation date: 2026-10-17 UTC.
    - Distribution: CachyOS, x86_64.
    - Kernel package: linux-cachyos 7.2.9-2; running kernel release 7.2.9-2-cachyos.
    - Community desktop package: codex-desktop 2026.10.14.044033-1.
    - Bundled Codex CLI: 0.162.0-alpha.17.2.
    - Bundled Node: v24.21.0; Codegraph's Node: v24.16.0; system Node: v26.11.1.
    - Observed local tools include Codegraph 1.6.1, computer-use, Codex Security 0.1.32, a code-review plugin and codex-app-tools 0.1.6.
    - Physical RAM: approximately 32 GB; about 16 GiB available during the initial probe.
    - The native probe inherited soft/hard RLIMIT_MEMLOCK of 8,388,608 bytes.
    - kernel.io_uring_disabled=0; page size=4,096 bytes.
    
    User-visible impact
    
    I encountered this while launching and using another application with Codex still open. The other application crashes when initialising an I/O-backed feature. Investigation found that its I/O initialisation failed under the exhausted allowance.
    
    The application-specific crash is context for this report, not the reproducer or a request to debug that application. The independent native probe below reproduces io_uring_queue_init(200, ..., 0) returning -12 (Cannot allocate memory) under the same allocation state. It requires no installation, account or configuration for the affected application.
    
    Observed queue ownership
    
    The process/queue snapshot was captured on the observation date above:
    
    Owner                                      Processes   Distinct queues   Mapped bytes
    Codegraph                                  16          60                1,720,320
    Computer-use                               16          48                1,376,256
    Codex Security                             16          46                1,318,912
    Code-review plugin                         16          48                1,376,256
    Codex app-tools servers                    14          40                1,146,880
    Tool wrappers; exact implementation unknown 14          42                1,204,224
    Codex desktop GUI                           1           5                  143,360
    Separate third-party-tool Node process               1           3                   86,016
    TOTAL                                      94         292                8,372,224
    
    The first six rows are Node descendants of the same live Codex app-server process (pseudonym APP_SERVER in the sanitised snapshot). They account for 284 queues and 8,142,848 bytes. Including the desktop GUI gives 289 queues and 8,286,208 bytes attributable to the desktop process tree. The separate third-party-tool process is not included in that subtree.
    
    Descriptors were deduplicated by queue inode: there were 292 distinct inodes, not merely 292 duplicated descriptors. Each queue had 256 submission slots and 512 completion slots. /proc/PID/maps showed two mappings per queue: 16,384 bytes at offset 0x10000000 and 12,288 bytes at offset zero, totalling seven pages (28,672 bytes).
    
        Existing queues: 292 * 28,672 = 8,372,224 bytes = 2,044 pages
        Effective limit:                 8,388,608 bytes = 2,048 pages
        Remaining allowance:               16,384 bytes =     4 pages
        Additional 200-entry queue:        28,672 bytes =     7 pages
    
    The queue mappings alone are not being treated as a generic locked-memory meter: the controlled threshold test below independently agrees with this accounting.
    
    Controlled reproduction at the exact boundary
    
    All probe children ran as the ordinary user, without elevated capabilities. Each successful queue was closed and its child exited; a one-second interval separated attempts to allow deferred cleanup. Only each disposable child's own soft RLIMIT_MEMLOCK was varied. Existing applications, hard limits and system settings were untouched.
    
    Test                       Child soft limit   Requested entries   Return
    Below predicted boundary   8,376,320 bytes     1                   -12 ENOMEM
    At predicted boundary      8,380,416 bytes     1                     0 success
    Repeat below boundary      8,376,320 bytes     1                   -12 ENOMEM
    Repeat at boundary         8,380,416 bytes     1                     0 success
    200-entry/original limit   8,388,608 bytes   200                   -12 ENOMEM
    
    A one-entry queue requires two pages. The switch from failure at 2,045 pages to success at 2,046 pages agrees exactly with 2,044 pages already accounted for. This distinguishes allowance exhaustion from ordinary free-RAM pressure and filesystem permissions.
    
    The earlier rapid probe also consistently failed at 200 entries, but small queues became unavailable in subsequent immediate attempts. That variation is preserved in initial-allocation-probe.json. The later controlled experiment used separate children and one-second intervals; it is the stronger boundary evidence.
    
    How to replay the allocation test
    
    Run the attached script as the ordinary affected user in a native host terminal, while the affected desktop processes remain running. It requires Python 3 and an already installed liburing shared library, but installs nothing:
    
        python3 reproduce.py --entries 1 8 200
    
    To replay the captured boundary tests on the same allocation state:
    
        python3 reproduce.py --soft-limit-bytes 8376320 --entries 1
        python3 reproduce.py --soft-limit-bytes 8380416 --entries 1
        python3 reproduce.py --entries 200
    
    Expected results in the captured state are failure, success, failure. The exact numerical boundary depends on all existing allocations and can move if applications start or exit. The script reports the inherited limits and native return codes; it does not assume the problem is present.
    
    The exact attached reproduce.py was also executed on the native host before packaging: 1- and 8-entry requests succeeded and the 200-entry request returned -12. See diagnostics/submission-reproducer-verification.json.
    
    The full accumulation sequence has not been reduced to a clean-room reproduction. The observed sequence was to use multiple Codex chats/tools over several days, leave the desktop running, and later launch and use an unrelated application. This is a live-state reproduction of the resource failure, not a claim that any fixed number of chats will always reproduce it.
    
    Why the allocations remain while tasks appear idle
    
    The owners are live tool-server processes still parented by Codex, rather than orphaned children. Seventy-three of the Node processes were older than 24 hours. During a three-second sample, 93 of 94 queue-owning processes used no CPU; 86 recorded no storage read/write bytes. Ninety-four queues had all submission/completion counters zero. An idle process can retain an allocated queue without current disk traffic.
    
    The server ages establish persistence over more than a day, not when the threads last had activity or when the allowance first became full. Detailed activity timestamps are omitted from the public evidence.
    
    Official app-server documentation says that, after the last subscriber leaves, a thread remains loaded until there have been no subscribers and no thread activity for 30 minutes. Inspection of the installed frontend confirms that extension-host retirement attempts thread/unsubscribe, sometimes deferring it until outstanding requests finish. It does not establish that cleanup succeeded for each surviving worker.
    
    Retained rotated logs over several days contain 75 extension-host creations and 73 retirements. These are not leak counts. The evidence does not distinguish intentional retained subscriptions from a cleanup failure for every instance.
    
    Separate configuration errors
    
    An enabled chrome-devtools configuration points to a missing executable:
    
        /opt/codex-desktop/resources/node-runtime/bin/npx
    
    Retained logs contain 1,957 startup/discovery failures for chrome-devtools and 397 No-such-file startup failures for third-party-cloud-tool. These are confirmed setup errors, but they have not been shown to cause the retained workers or queue exhaustion. The underlying launch command for third-party-cloud-tool was not established. They are included as potentially relevant context, not as the asserted root cause.
    
    Expected behaviour and requested investigation
    
    Please investigate whether these simultaneous tool-server instances and their retention are expected for this build, especially where chats appear idle. If retention is intentional, is there a supported way to bound idle tool resources or configure an appropriate memory allowance? If contexts were retired, please check whether all associated servers were actually released.
    
    At this scale, a small per-server reservation collectively consumes nearly all of a common 8 MiB allowance and prevents unrelated applications from using io_uring. It would be useful to reduce redundant queue allocation, release unneeded servers, or make the resource requirement and supported configuration clear. This report does not prescribe which layer owns the correction.
    
    Limits of the result
    
    - The native queue-allocation failure, exact accounting boundary and process ownership were verified. An unbounded leak, specific cleanup defect and regression-causing update were not proved.
    - The community packaging and third-party/custom tool mix may be relevant. No comparison with an unmodified official desktop build or a minimal tool configuration was performed.
    - A 64 MiB positive-control test could not run because sudo required a password. No raised-limit helper ran. The exact lower-boundary test succeeded without administrator access.
    - No workers were stopped, no restart was performed, no existing application limit or setting was changed, and the affected application was not retested after an intervention. A fix is not claimed.
    - The three-second idle sample is not a complete activity history. Process counts and queue ownership are snapshots.
    
    References
    
    Official app-server lifecycle documentation:
    https://developers.openai.com/codex/app-server/
    
    systemd default configuration (DefaultLimitMEMLOCK=8M; linked as reference, not a pin of the installed source):
    https://github.com/systemd/systemd/blob/main/src/core/system.conf.in
    
  3. Axel3121 commented on Oct 19, 2026

    @Axel3121

    Still reproduces on chatgpt 26.1007.21434 (Fedora 44, kernel 7.2.5, X11).

    After ~3 h 17 min, these sets were alive as children of the single /usr/lib/chatgpt/resources/codex app-server:

    • cua_node/bin/node ./server.mjs ×2 (cwd ~/.codex/code-review-plugin and ~/.codex/plugins/cache/openai-bundled/codex-app-tools/0.1.6)
    • cua_node/bin/node_repl
    • cua_node/.../@oai/cua-repl/bin/cua-repl.mjs

    There were six complete sets with elapsed times of 2:53 h, 1:56 h, 1:05 h, 58 min, 8 min and 23 s. Each set uses ~150 to 300 MB RSS. Sets from finished threads are never terminated, so memory grows linearly with thread count (~54 threads in that window).

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

    Linuxappapp-serverbugcomputer-useperformance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions