macOS
Terminal
Killed:9
troubleshooting
command line

What "Killed: 9" means in macOS Terminal and how to fix it

Codemia Knowledge Hub ·

Killed: 9 means the process received signal 9, SIGKILL, which stops it immediately without any chance to clean up or print an error. The signal is the effect, not the cause, so fixing it means finding out who sent it and why.

What signal 9 is

SIGKILL is the kill signal that a process cannot catch or ignore on Unix-like systems. It can come from:

  • your own kill -9 command
  • another privileged process
  • the kernel under memory pressure
  • a macOS security mechanism rejecting the process

Memory pressure

A common cause is the system terminating a process that uses too much memory. This is especially likely with browsers, machine learning tools, large compilers and data-processing jobs. Check memory in Activity Monitor or from Terminal:

bash
top -o mem

If the process dies when its memory use spikes, reduce the workload, close other heavy apps, or otherwise cut memory demand.

A kill you sent yourself

Sometimes the process really was killed from another shell or a script, with commands like:

bash
kill -9 12345
pkill -9 myprocess

If a script or supervisor manages the process, inspect that control path before blaming macOS.

Quarantine and code-signing problems

macOS may start an unsigned or quarantined binary and then terminate it because it does not trust the binary or its environment. Check for quarantine attributes:

bash
xattr -l /path/to/your/binary

If quarantine metadata is present and you trust the binary, removing the attribute may be part of the fix:

bash
xattr -d com.apple.quarantine /path/to/your/binary

Only do this when you know where the binary came from and why you trust it.

Reading the macOS logs

When the cause is not obvious, the system log says more than the terminal does:

bash
log show --last 5m --predicate 'eventMessage CONTAINS "killed"'

Or search for the process name:

bash
log show --last 5m --predicate 'eventMessage CONTAINS "your-process-name"'

The log can show whether the process was ended by memory pressure, policy enforcement or another system component.

Apple Silicon and binary compatibility

On Apple Silicon Macs, some older binaries still depend on Rosetta or specific library combinations, and an incompatible binary can fail as an abrupt termination. Check its architecture:

bash
file /path/to/your/binary

For an Intel-only binary on Apple Silicon, confirm Rosetta is installed and that the toolchain is actually compatible.

Wrapper scripts and the real executable

The process being killed may be an interpreter or a child launched by a wrapper script rather than the command you typed. Confirm the exact executable path and its permissions:

bash
which python3
which node
ls -l /path/to/script.sh

If a script launches a different binary than you expect, the real problem is one layer deeper.

Debugging order

  1. check whether memory pressure is the cause
  2. check whether you or a supervisor sent SIGKILL
  3. inspect the macOS logs
  4. verify the binary's architecture and trust state
  5. reduce the workload or replace the problematic binary

Working through these steps is more reliable than guessing from the terminal message alone.


Free course
Beginner
7 lessons
2 hours
Tackling System Design Interview Problems

A short course that equips you with the skills to approach system design interviews methodically.

Start the free course
Basis Lab
No course covers this one yet

Basis Lab writes one for you from a sentence about what you want to be able to do, then teaches it and checks you understood. Your first course is free.

Build my course
Interview Questions practice on Codemia

Over 11,000 interview practice questions for 300+ companies, searchable by company and role.

Browse interview questions