codex - 💡(How to fix) Fix macOS: MallocStackLogging: can't turn off malloc stack logging because it was not enabled. appears when running Codex v0.118.0 [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#17139Fetched 2026-04-09 08:01:58
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1unlabeled ×1

Error Message

expected behavior: I shouldn't see the repeated flooding of the error.

Root Cause

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

Code Example

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

---

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

---

env | grep -i malloc
RAW_BUFFERClick to expand / collapse

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:
    codex(...) MallocStackLogging: can't turn off malloc stack logging because it was not enabled.
  4. Leave Codex running for a short time
  5. 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:

    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.

extent analysis

TL;DR

The issue can be mitigated by disabling malloc stack logging for the Codex process or investigating why Codex is attempting to disable it when it's not enabled.

Guidance

  • Investigate Codex's configuration and code to determine why it's attempting to disable malloc stack logging when it's not enabled.
  • Consider setting the MallocStackLogging environment variable to a specific value (e.g., 0) before launching Codex to see if it prevents the repeated warnings.
  • Review the Codex documentation and macOS platform specifics to understand how malloc stack logging interacts with the Codex process.
  • If the issue persists, try launching Codex from a different terminal emulator or environment to isolate if the problem is specific to Terminal.app.

Example

No specific code snippet is provided as the issue seems related to environment variables and process configuration rather than code.

Notes

The solution may depend on the specifics of Codex's implementation and how it interacts with macOS's memory management features. Further investigation into Codex's documentation and source code may be necessary.

Recommendation

Apply a workaround by setting environment variables or configuring Codex to avoid attempting to disable malloc stack logging when it's not enabled, as upgrading to a fixed version is not mentioned as an option in the provided issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING