Intel Mac: Julia killed with "Code Signature Invalid" when loading RMS (conda leaves invalid signatures on osx-64 binaries)
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 25/100
調査の方向性
The issue says PR #3038 adds the workaround in python utilities.py and updates install_rms.sh; start by reviewing that pull request and the conda metadata files under conda-meta/. Done means the affected patched binaries with invalid signatures are re-signed and the installer runs the fix. The issue describes an upstream conda and micromamba fix as the proper resolution.
索引モデルが issue の本文から書いたものです。
説明
Note: This issue was drafted by Claude (Anthropic's AI assistant, via Claude Code) at Richard West's request.
Symptom
On an Intel Mac, running Julia directly and loading RMS kills Julia with no error message:
$ julia -e 'using ReactionMechanismSimulator'
zsh: killed julia -e 'using ReactionMechanismSimulator' # exit code 137
macOS writes a crash report (~/Library/Logs/DiagnosticReports/julia-*.ips) that says:
"exception" : {"type":"EXC_BAD_ACCESS","signal":"SIGKILL (Code Signature Invalid)", ...}
"termination" : {"namespace":"CODESIGNING","indicator":"Invalid Page", ...}
and whose crashing thread is in a Python extension module, e.g. kiwisolver/_cext.cpython-311-darwin.so (imported by matplotlib, which RMS loads through PythonPlot).
This happens in plain julia (the REPL, scripts, RMS's own test suite, Jupyter/VS Code Julia sessions, and the "Loading RMS" check in install_rms.sh). Running RMG itself is not affected: there Python is the main process and loads Julia into it, and Python doesn't enforce code signatures.
Cause
- When conda installs a package, it rewrites the build-time path stored inside some binaries ("binary prefix replacement"). This changes their contents.
- For osx-arm64 packages, conda then re-signs the file (ad hoc). For osx-64 packages it doesn't (
conda/core/portability.py:if updated and mode == FileMode.binary and subdir == "osx-arm64" and on_mac:). micromamba, which CondaPkg uses, has the same rule (libmamba/src/core/link.cpp). pixi/rattler re-signs on every macOS platform. - Older conda-forge osx-64 binaries were unsigned, so this didn't matter. Recent builds are ad hoc signed (kiwisolver 1.4.5 and 1.4.8 were unsigned; 1.4.9 and 1.5.0 are signed), so after installation they carry a signature that no longer matches.
codesign --verifyreportsinvalid signature (code or signature have been modified). - The official Julia binaries (from juliaup) are signed with Apple's hardened runtime. The kernel kills a hardened-runtime process as soon as it touches a page whose signature doesn't match. Conda's
pythonis unsigned, so the same imports work fine from Python.
In my rmg_env there were 25 such files, from kiwisolver, greenlet, sqlalchemy, ruamel.yaml, backports.zstd, debugpy, glib, dbus, libedit and vulkan-loader. Which packages are affected depends on the build, so the list will vary.
Who is affected
- Intel Macs (and osx-64 environments under Rosetta), using RMS from Julia directly with a conda environment's Python. That includes RMG developers running RMS's tests or using RMS from the Julia REPL.
- Probably RMS users on Intel Macs who install it standalone with CondaPkg, since micromamba has the same rule (not tested).
- Not affected: Apple Silicon with native (osx-arm64) environments, Linux, Windows, and RMG runs on any platform.
It will come back with every new environment, and after conda install/conda update of an affected package.
Fix / workaround
Re-sign the affected files ad hoc:
codesign --force --sign - path/to/file.so
#3038 adds python utilities.py fix-macos-signatures, which finds the files conda patched (from conda-meta/*.json) and re-signs only those with invalid signatures, and makes install_rms.sh run it. Run it again after installing or updating conda packages.
The proper fix is upstream, in conda and micromamba (re-sign patched binaries on osx-64 too, at least when they were signed). Links to upstream issues will be added here.
Related
install_rms.sh runs using ReactionMechanismSimulator in plain julia as a check, but the || echo "... continuing anyway" after it means the script still reports success when that check is killed, so the problem went unnoticed.
🤖 Generated with Claude Code
- 主要言語
- Python
- スター
- 550
- フォーク
- 267
- 平均マージ
- 8時間 49分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ReactionMechanismGenerator/RMG-Py のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
ReactionMechanismGenerator/RMG-Py#3044 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
ReactionMechanismGenerator/RMG-Py#3014 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
ReactionMechanismGenerator/RMG-Py#3035 ·
メンテナーはふだん 1 日以内に返信
-
RMS reactors: hard-coded unpreconditioned GMRES linear solver makes stiff surface/electrochemical edge simulations fail対応中かも @rwest が 29 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
ReactionMechanismGenerator/RMG-Py#3034 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 57/100
ReactionMechanismGenerator/RMG-Py#3030 ·
メンテナーはふだん 1 日以内に返信
ReactionMechanismGenerator/RMG-Py の issue をすべて見る
似ている issue
-
docs(contributing): the two things that silently block a PR対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンavailable documentation good first issue
難易度 1/5 1〜3時間 初心者へのやさしさ 95/100
Nixitov/Riptide-Native#944 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
JTHCode/secretguard#24 ·
メンテナーはふだん 1 日以内に返信
-
area: middleware documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
omarelshamy25x/shamy-hijri#63 ·
メンテナーはふだん 1 日以内に返信