MacOS – How to kill a process that won’t die

activity-monitormacosterminal

I'm unable to kill a process using any of the techniques I'm aware of ("Force Quit" in Activity Monitor, top, killall from the Terminal) and wonder if there are some additional steps I can take.

enter image description here

~ $ sudo killall -KILL 77439
Password:
No matching processes were found
~ $ killall -KILL 77439
No matching processes belonging to you were found
~ $ killall 77439
No matching processes belonging to you were found
~ $ killall Mathematica
No matching processes belonging to you were found

FWIW the process is "Mathematica" which I cannot relaunch, Quit, or Force Quit, or sample, either by name or PID, and it appears to have some odd side effects (screenshots don't appear, can't empty trash, and can't even shut down the system).

Are there additional steps that can be taken to really really kill a badly behaved process?

Best Answer

killall kills by process name (which is definitively not 77439 and most probably also not Mathematica). You can use kill 77439 or (if this fails) kill -9 77439 instead (but if the process is really stuck, only a reboot will solve the problem).

Also, due the the way sending/processing of signals (like kill -9) works in Unix/OS X, there are situations where a process will be unkillable. One typical example for this is if a process gets stuck while accessing some external device and never actually gets control back. In such situations a reboot is the only way to get rid of the process.