带有 macOS Big Sur 11.2.1 的 apple m1 安装软件失败,出现被杀死的错误

apple m1 with macOS Big Sur 11.2.1 install soft faild, with killed error

当 rbenv 安装时 ruby

generating arm64-darwin20-fake.rb
arm64-darwin20-fake.rb updated
./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems -r./arm64-darwin20-fake ./tool/rbinstall.rb --make="make" --dest-dir="" --extout=".ext" --mflags="" --make-flags="" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="doc" --rdoc-output=".ext/rdoc" --html-output=".ext/html"
make: *** [do-install-all] Killed: 9

当 pyenv 安装时 python

/bin/sh: line 1: 59082 Killed: 9               CC='clang' LDSHARED='clang -bundle -undefined dynamic_lookup -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/readline/lib -L/Users/lidashuang/.pyenv/versions/3.9.2/lib -L/opt/homebrew/opt/openssl@1.1/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/readline/lib -L/Users/lidashuang/.pyenv/versions/3.9.2/lib -L/opt/homebrew/opt/openssl@1.1/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib  ' OPT='-DNDEBUG -g -fwrapv -O3 -Wall' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python.exe -E ./setup.py $quiet build

当自制程序安装时 python

subprocess.CalledProcessError: Command '['/opt/homebrew/opt/python@3.9/bin/python3.9', '-c', '\nimport runpy\nimport sys\nsys.path = [\'/private/tmp/tmp7q_qlu62/setuptools-49.2.1-py3-none-any.whl\', \'/private/tmp/tmp7q_qlu62/pip-20.2.3-py2.py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'/private/tmp/tmp7q_qlu62\', \'setuptools\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n']' died with <Signals.SIGKILL: 9>.

died with <Signals.SIGKILL: 9>.

系统日志

Feb 22 08:36:31 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.redis[78933]): Binary is improperly signed.
Feb 22 08:36:31 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.redis): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Feb 22 08:36:41 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.postgresql[80633]): Binary is improperly signed.
Feb 22 08:36:41 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.postgresql): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Feb 22 08:36:41 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.redis[80634]): Binary is improperly signed.
Feb 22 08:36:41 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.redis): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Feb 22 08:36:43 dashuangdeMacBook-Pro Google Chrome Helper[634]: Libnotify: notify_register_coalesced_registration failed with code 9 on line 2835
Feb 22 08:36:49 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (com.apple.mdworker.shared.0F000000-0500-0000-0000-000000000000[78921]): Service exited due to SIGKILL | sent by mds[98]
Feb 22 08:36:51 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.redis[82032]): Binary is improperly signed.
Feb 22 08:36:51 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.redis): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Feb 22 08:36:51 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.postgresql[82031]): Binary is improperly signed.
Feb 22 08:36:51 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.postgresql): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Feb 22 08:37:01 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.postgresql[83275]): Binary is improperly signed.
Feb 22 08:37:01 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.postgresql): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Feb 22 08:37:01 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.redis[83274]): Binary is improperly signed.
Feb 22 08:37:01 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.redis): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Feb 22 08:37:03 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (com.apple.mdworker.shared.0E000000-0200-0000-0000-000000000000[78506]): Service exited due to SIGKILL | sent by mds[98]
Feb 22 08:37:03 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (com.apple.mdworker.shared.0B000000-0100-0000-0000-000000000000[78918]): Service exited due to SIGKILL | sent by mds[98]
Feb 22 08:37:03 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (com.apple.mdworker.shared.10000000-0300-0000-0000-000000000000[78920]): Service exited due to SIGKILL | sent by mds[98]
Feb 22 08:37:03 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (com.apple.mdworker.shared.04000000-0500-0000-0000-000000000000[78919]): Service exited due to SIGKILL | sent by mds[98]
Feb 22 08:37:11 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (com.apple.mdworker.shared.03000000-0200-0000-0000-000000000000[78925]): Service exited due to SIGKILL | sent by mds[98]
Feb 22 08:37:11 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.redis[84978]): Binary is improperly signed.
Feb 22 08:37:11 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.redis): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Feb 22 08:37:11 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.postgresql[84977]): Binary is improperly signed.
Feb 22 08:37:11 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.postgresql): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Feb 22 08:37:21 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.redis[89274]): Binary is improperly signed.
Feb 22 08:37:21 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.redis): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Feb 22 08:37:21 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.postgresql[89286]): Binary is improperly signed.
Feb 22 08:37:21 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.postgresql): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Feb 22 08:37:31 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.postgresql[94316]): Binary is improperly signed.
Feb 22 08:37:31 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.postgresql): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Feb 22 08:37:31 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.redis[94315]): Binary is improperly signed.
Feb 22 08:37:31 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.redis): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Feb 22 08:37:31 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (com.apple.mdworker.shared.0F000000-0600-0000-0000-000000000000[81563]): Service exited due to SIGKILL | sent by mds[98]
Feb 22 08:37:32 dashuangdeMacBook-Pro systemstats[79]: assertion failed: 20D74: systemstats + 399948 [146262DC-951A-39E6-88F2-E8A328A3A263]: 0x0
Feb 22 08:37:32 dashuangdeMacBook-Pro systemstats[79]: assertion failed: 20D74: systemstats + 602280 [146262DC-951A-39E6-88F2-E8A328A3A263]: 0x2
Feb 22 08:37:41 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.postgresql[9177]): Binary is improperly signed.
Feb 22 08:37:41 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.postgresql): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Feb 22 08:37:41 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.redis[9178]): Binary is improperly signed.
Feb 22 08:37:41 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.redis): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Feb 22 08:37:43 dashuangdeMacBook-Pro Google Chrome Helper[634]: Libnotify: notify_register_coalesced_registration failed with code 9 on line 2835
Feb 22 08:37:51 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.postgresql[9181]): Binary is improperly signed.
Feb 22 08:37:51 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.postgresql): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Feb 22 08:37:51 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.redis[9182]): Binary is improperly signed.
Feb 22 08:37:51 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (homebrew.mxcl.redis): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Feb 22 08:37:53 dashuangdeMacBook-Pro com.apple.xpc.launchd[1] (com.apple.mdworker.shared.03000000-0600-0000-0000-000000000000[94450]): Service exited due to SIGKILL | sent by mds[98]

很多Service exited due to SIGKILL | sent by mds[98]错误

问题是 Mac OS 本身的 update/upgrade。 Ruby 和 Python 很可能取决于已经安装在旧版本 Mac OS 上的库(例如 11.1.X)。该更新打破了自制软件应用的临时签名,例如可执行文件和库。

为了解决这个问题,我做了以下事情:

  1. 启动 Console 应用程序并查看 Crash Reports 应该有一个尝试启动的应用程序条目。例如Python.
  2. 条目中有以下提示:
Exception Type:        EXC_BAD_ACCESS (Code Signature Invalid)
Exception Codes:       0x0000000000000032, 0x0000000104ea8000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace CODESIGNING, Code 0x2

kernel messages:

VM Regions Near 0x104ea8000:
    __LINKEDIT                  104ea0000-104ea8000    [   32K] r--/rwx SM=COW  /opt/homebrew/*/Python.framework/Versions/3.8/lib/python3.8/lib-dynload/_hashlib.cpython-38-darwin.so
--> mapped file                 104ea8000-104eac000    [   16K] r--/r-x SM=PRV  Object_id=29cb6af3
    MALLOC_MEDIUM               140000000-140800000    [ 8192K] rw-/rwx SM=PRV  

Application Specific Information:
dyld: in dlopen()
/opt/homebrew/opt/openssl@1.1/lib/libssl.1.1.dylib
  1. 用自制软件重新安装相关包,例如brew reinstall openssl 或 应用程序的每个依赖项
    例如,您正在尝试 运行 brew reinstall $(brew deps python).

我在使用 apple silicon 的新 M1 macbook air 上遇到了很多类似的问题:

“zsh:被杀死git” “zsh:杀死 python3” 等等

git 问题已由 uninstalling/reinstalling git 在 homebrew 下修复:brew reinstall git / brew update git.

brew reinstall $(brew deps python) 在尝试了所有其他方法后解决了 python3 的问题(只是重新安装 python 不起作用 - 所有 deps 都需要更新)。 .. 谢谢!