You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
macOS: MallocStackLogging warning persists in v1.0.80 #4614
The following diagnostic still appears in Copilot CLI TUI windows on macOS with Copilot CLI v1.0.80:
copilot(<pid>) MallocStackLogging: can't turn off malloc stack logging because it was not enabled.
I observed it twice in succession from separate Copilot subprocesses. This appears to be a regression or incomplete fix for #4375, which was reported against v1.0.77 and closed as completed.
Steps to reproduce
Launch Copilot CLI on macOS.
Use the TUI normally so that Copilot invokes subprocesses or tools.
Observe the diagnostic written into the TUI output, sometimes repeatedly with different process IDs.
Expected behavior
Copilot should not call the macOS stack-logging shutdown function when malloc stack logging is not enabled, and no diagnostic should be written into the TUI.
Actual behavior
The diagnostic appears in the TUI:
MallocStackLogging: can't turn off malloc stack logging because it was not enabled.
I reproduced this on an actual signed 1.0.79 session and then isolated a deterministic trigger. This does not appear to be a 1.0.80 regression or something that happens on every tool call.
Verified version range
Version
Result when the macOS MSL-disable callback fires
1.0.68
warning rendered inside TUI
1.0.77
warning rendered inside TUI
1.0.79 / 1.0.79-9
warning rendered inside TUI
1.0.80
warning rendered inside TUI
1.0.81-0, -3, -4, -5, -9
warning rendered inside TUI
1.0.81 stable
warning rendered inside TUI
1.0.82-0
warning rendered inside TUI
The naturally occurring case remains intermittent. Clean controls produced zero warnings from:
--version, mcp list, and plugins list across cached versions
20 direct launches each of zsh, bash, Ruby, Python, and /usr/bin/true
an interactive bash tool call
sync and background task agents
an async Ruby shell command
Isolated trigger
Apple's public libmalloc source shows that malloc_memory_event_handler() dynamically loads MallocStackLogging.framework and forwards memory-status events to msl_handle_memory_event():
MEMORYSTATUS_DISABLE_MSL is 0x80000000. Calling the framework handler with that event while stack logging is inactive deterministically emits the exact diagnostic:
repro(<pid>) MallocStackLogging: can't turn off malloc stack logging because it was not enabled.
I injected that same callback after startup into each published Copilot TUI package listed above (using its matching app.js and native modules under an injectable Node host). Every version wrote one diagnostic directly into the alternate-screen UI.
I also scanned the signed launcher and matching native modules for every tested version:
The MallocStackLogging strings inside runtime.node are environment-variable names; the diagnostic text and turn_off_stack_logging symbol/name are absent. I therefore could not substantiate the direct native-addon call asserted in #4375.
Conclusion
The underlying diagnostic is emitted by macOS when an MSL-disable memory-status event reaches a process where MSL was not enabled. The Copilot-specific bug is that an asynchronous native write to file descriptor 2 escapes into and corrupts the TUI. This also explains reports from unrelated long-running processes such as Ruby, Codex, and k9s.
A robust CLI-side fix would route process-level stderr through the logger/TUI renderer (or narrowly suppress this known harmless diagnostic) so asynchronous native diagnostics cannot draw directly into the alternate screen.
Environment: macOS 15.7.4 (24G517), arm64, iTerm2 3.6.11; MallocStackLogging, MallocStackLoggingNoCompact, MallocNanoZone, and DYLD_INSERT_LIBRARIES all unset in the natural occurrence.
Still present on 1.0.83, so the version table above extends one more release.
copilot(<pid>) MallocStackLogging: can't turn off malloc stack logging because it was not enabled.
One detail that supports the conclusion in the comment above about the write escaping the renderer. On the same machine where this appears in the TUI, the string is absent from every log file, including runs started with --log-level debug --log-dir, and it is absent from the session transcript in events.jsonl. Nothing that passes through the logger ever sees it, which is consistent with an asynchronous native write going straight to file descriptor 2 while the alternate screen is active. It also means an affected user cannot produce a captured artifact for a bug report, only a screenshot.
Environment: Copilot CLI 1.0.83, macOS 26.6.2 (25G83), arm64, installed at /usr/local/bin/copilot. MallocStackLogging, MallocNanoZone, and DYLD_INSERT_LIBRARIES all unset.
Activity
DavidTeju commentedon Aug 28, 2026
[From Femi's agent: GPT-5.6 Sol]
I reproduced this on an actual signed 1.0.79 session and then isolated a deterministic trigger. This does not appear to be a 1.0.80 regression or something that happens on every tool call.
Verified version range
The naturally occurring case remains intermittent. Clean controls produced zero warnings from:
--version,mcp list, andplugins listacross cached versions/usr/bin/trueIsolated trigger
Apple's public
libmallocsource shows thatmalloc_memory_event_handler()dynamically loadsMallocStackLogging.frameworkand forwards memory-status events tomsl_handle_memory_event():MEMORYSTATUS_DISABLE_MSLis0x80000000. Calling the framework handler with that event while stack logging is inactive deterministically emits the exact diagnostic:I injected that same callback after startup into each published Copilot TUI package listed above (using its matching
app.jsand native modules under an injectable Node host). Every version wrote one diagnostic directly into the alternate-screen UI.I also scanned the signed launcher and matching native modules for every tested version:
The
MallocStackLoggingstrings insideruntime.nodeare environment-variable names; the diagnostic text andturn_off_stack_loggingsymbol/name are absent. I therefore could not substantiate the direct native-addon call asserted in #4375.Conclusion
The underlying diagnostic is emitted by macOS when an MSL-disable memory-status event reaches a process where MSL was not enabled. The Copilot-specific bug is that an asynchronous native write to file descriptor 2 escapes into and corrupts the TUI. This also explains reports from unrelated long-running processes such as Ruby, Codex, and k9s.
A robust CLI-side fix would route process-level stderr through the logger/TUI renderer (or narrowly suppress this known harmless diagnostic) so asynchronous native diagnostics cannot draw directly into the alternate screen.
Environment: macOS 15.7.4 (24G517), arm64, iTerm2 3.6.11;
MallocStackLogging,MallocStackLoggingNoCompact,MallocNanoZone, andDYLD_INSERT_LIBRARIESall unset in the natural occurrence.1fanwang commentedon Sep 8, 2026
Still present on 1.0.83, so the version table above extends one more release.
One detail that supports the conclusion in the comment above about the write escaping the renderer. On the same machine where this appears in the TUI, the string is absent from every log file, including runs started with
--log-level debug --log-dir, and it is absent from the session transcript inevents.jsonl. Nothing that passes through the logger ever sees it, which is consistent with an asynchronous native write going straight to file descriptor 2 while the alternate screen is active. It also means an affected user cannot produce a captured artifact for a bug report, only a screenshot.Environment: Copilot CLI 1.0.83, macOS 26.6.2 (25G83), arm64, installed at
/usr/local/bin/copilot.MallocStackLogging,MallocNanoZone, andDYLD_INSERT_LIBRARIESall unset.