macOS: MallocStackLogging: can't turn off malloc stack logging because it was not enabled. appears when running Codex v0.118.0

Resolved 💬 8 comments Opened Apr 8, 2026 by sriinnu Closed May 25, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

v0.118.0

What subscription do you have?

pro

Which model were you using?

gpt-5.4

What platform is your computer?

Darwin 24.6.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

Terminal.app

What issue are you seeing?

codex(3912) MallocStackLogging: can't turn off malloc stack logging because it was not enabled.

What steps can reproduce the bug?

  1. Open Terminal.app on macOS
  2. Launch Codex
  3. Observe repeated log output:

``text
codex(...) MallocStackLogging: can't turn off malloc stack logging because it was not enabled.
``

  1. Leave Codex running for a short time
  2. Terminal becomes filled with the repeated warning messages

What is the expected behavior?

expected behavior: I shouldn't see the repeated flooding of the error.
Codex should not continuously emit malloc logging warnings during normal use.
If malloc stack logging is not enabled, Codex should not repeatedly attempt to disable it or surface this warning to the user.

Additional information

  • Version: v0.118.0
  • Platform: macOS
  • Running via: Terminal.app
  • Reproducibility: every launch
  • Restarting Codex does not fix it
  • Checked Terminal environment with:

``bash
env | grep -i malloc
``

No malloc-related environment variables were present.

This suggests the repeated warning is not caused by user-set shell environment variables such as MallocStackLogging or MallocStackLoggingNoCompact.

The issue appears to be caused by Codex or one of its macOS runtime components repeatedly attempting to disable malloc stack logging when it is not enabled.

View original on GitHub ↗

8 Comments

Pavilion-devs · 3 months ago

Yes been having this issue too for a while

etraut-openai contributor · 3 months ago

This appears to be a side effect of the attempt to fix https://github.com/openai/codex/issues/11555.

zhan9yx · 3 months ago

Encountered this issue as well

Don-Yin · 2 months ago

Still seeing this class of warning on current latest Codex CLI, so this does not appear fixed by the releases after 0.118.0.

Environment:

  • Codex CLI: codex-cli 0.125.0
  • npm @openai/codex latest: 0.125.0
  • install path: /opt/homebrew/bin/codex -> ../lib/node_modules/@openai/codex/bin/codex.js
  • macOS: 26.4.1 (25E253), Darwin 25.4.0, arm64

Observed warning pattern in an interactive Codex session:

codex(...) MallocStackLogging: can't turn off malloc stack logging because it was not enabled.

Local checks I ran:

  • env | sort | rg -i 'malloc|stack|guard|zombie|dyld' -> no malloc-related environment variables
  • launchctl getenv MallocStackLogging, MallocStackLoggingNoCompact, MallocScribble, NSZombieEnabled -> blank
  • searched shell config files (~/.zshenv, ~/.zprofile, ~/.zshrc, ~/.bash_profile, ~/.bashrc) -> no MallocStackLogging* references
  • codex --version and env -i HOME=$HOME PATH=/opt/homebrew/bin:/usr/bin:/bin TERM=xterm-256color codex --version both print codex-cli 0.125.0 cleanly, so I only see the flood in the interactive TUI path rather than a simple non-interactive launch

This matches the report here, with the main difference that the affected version is now 0.125.0 rather than 0.118.0.

towry · 2 months ago

Still see this in codex-cli 0.130.0
Seems it happens when the warning message " Selected model is at capacity. Please try a different model." start to show up.

13zebras · 2 months ago

Happens repeatedly in codex-cli 0.130.0, to the point that the UI becomes unusable.

ayer-ribeiro · 2 months ago

I'm facing the same with codex-cli 0.130.0

<img width="333" height="103" alt="Image" src="https://github.com/user-attachments/assets/6525300c-fda4-44ca-abe9-3a7a4c045baa" />

Resize the terminal window sometime helps

Shuhao99 · 1 month ago

Me too, Codex CLI: codex-cli (v0.133.0)
codex(24754) MallocStackLogging: can't turn off malloc stack logging because it was not enabled.