Summary
On macOS, the copilot binary prints the following message to stderr once per subprocess spawned — meaning it appears on every tool call during a session:
copilot(20899) MallocStackLogging: can't turn off malloc stack logging because it was not enabled.
During an active session this message streams constantly, making it very noisy.
Steps to reproduce
- macOS (Apple Silicon or Intel)
- Run
copilot chat and use any tool (file read, bash, etc.)
- Observe stderr output — the message appears for each subprocess spawned
Root cause
The copilot binary (v1.0.77, Node.js v24.16.0 bundled) includes a native addon that calls turn_off_stack_logging() unconditionally at process startup. On macOS, this function is part of the malloc subsystem and prints the warning when called if stack logging was never enabled (i.e. MallocStackLogging env var was absent).
Because Copilot CLI spawns a fresh subprocess for every tool invocation, the message appears once per tool call rather than once per session.
The call site is in a bundled native addon — turn_off_stack_logging() is not present in Node.js core source itself.
Fix
Guard the call with a check before invoking turn_off_stack_logging():
// Before
turn_off_stack_logging();
// After
if (malloc_logger) {
turn_off_stack_logging();
}
malloc_logger is the macOS malloc global that is non-NULL only when stack logging is actually enabled. This is the standard guard used in system code.
Alternatively, check whether MallocStackLogging is set in the environment before making the call.
Workaround (for users)
Wrap the copilot call in a shell function that filters the specific stderr pattern:
function _copilot() {
copilot "$@" 2> >(grep -Fv 'MallocStackLogging:' >&2)
}
Environment
- macOS 15 (Sequoia), Apple Silicon
- copilot v1.0.77 (bundled Node.js v24.16.0)
- Installed via brew cask
Summary
On macOS, the
copilotbinary prints the following message to stderr once per subprocess spawned — meaning it appears on every tool call during a session:During an active session this message streams constantly, making it very noisy.
Steps to reproduce
copilot chatand use any tool (file read, bash, etc.)Root cause
The
copilotbinary (v1.0.77, Node.js v24.16.0 bundled) includes a native addon that callsturn_off_stack_logging()unconditionally at process startup. On macOS, this function is part of the malloc subsystem and prints the warning when called if stack logging was never enabled (i.e.MallocStackLoggingenv var was absent).Because Copilot CLI spawns a fresh subprocess for every tool invocation, the message appears once per tool call rather than once per session.
The call site is in a bundled native addon —
turn_off_stack_logging()is not present in Node.js core source itself.Fix
Guard the call with a check before invoking
turn_off_stack_logging():malloc_loggeris the macOS malloc global that is non-NULL only when stack logging is actually enabled. This is the standard guard used in system code.Alternatively, check whether
MallocStackLoggingis set in the environment before making the call.Workaround (for users)
Wrap the
copilotcall in a shell function that filters the specific stderr pattern:Environment