Since I upgraded my Mac OS, some programs get this error when running:
Killed: 9
I even execute them via sudo but they won't work.
Any idea?
Since I upgraded my Mac OS, some programs get this error when running:
Killed: 9
I even execute them via sudo but they won't work.
Any idea?
Open a new terminal window/tab
If you replace a signed macOS binary by using cp instead of mv then macOS caches the signature, doesn't like the look of it because the file changed and kills your process when you try and start the new binary. Clearly, this is a bug in macOS. We had to update our install scripts to copy the file a different way.
Download UPX. For example, using Homebrew, run brew install upx.
Decompress the binary:
upx -d /path/to/App.app/MacOS/App
Also see “This UPX compressed binary contains an invalid Mach-O header and cannot be loaded.”
upx =(
– Justin
May 04 '22 at 17:31
upx, how does this have any effect?
– Ed Randall
May 05 '22 at 10:11
in my case there was some process called syspolicy or something like that, once i killed that process, running my command python3 no longer returned killed 9.
I was able to fix it after running this command found in this homebrew github discussion:
brew reinstall pcre2 gettext
Hope this helps
This fixed it for me:
codesign --sign - --force --preserve-metadata=entitlements,requirements,flags,runtime <path-to-binary>
this command replaces the current signature in the binary file with a new one preserving the old information, in this way you reset the previous one that "alarms" the OS. more info here
I tried resetting the binaries and it did fix the issue for me. To reset the binaries for the macOS M1 terminal, you can follow these steps:
echo $PATH. This will display the current path for the terminal.echo $SHELL. This will display the current shell being used by the terminal./bin/bash, type the following command and press Enter: nano ~/.bash_profile. If the output is /bin/zsh, type the following command and press Enter: nano ~/.zshrc. This will open the shell configuration file in the nano text editor.export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin. This will reset the path to the default macOS path.source ~/.bash_profile or source ~/.zshrc, depending on which shell you are using.echo $PATH. This will display the new path for the terminal.ls or pwd.These steps should reset the binaries for the terminal and restore the default macOS path.
Killed: 9. I remember when Mac == Easy back in the 90's – Cerniuk Oct 27 '21 at 21:07Killed: 9error, by runningrmthencpinstead of justcp. Do you have a reference on this problem ? – Ortomala Lokni Oct 31 '21 at 18:29azcopyby copying the newer version over the top of it. I had usedxattrto removecom.apple.quarantineandcom.apple.maclattributes so this may have had some bearing on it as well. A reboot actually reverted theazcopybinary back to the previous version. – Ed Randall May 05 '22 at 10:20