Intel Mac: Julia killed with "Code Signature Invalid" when loading RMS (conda leaves invalid signatures on osx-64 binaries)

オープン
#3,037 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@rwest がすでに取り組んでいます。

2026年11月7日 から。

  • #3038 @rwest による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
julia, macos, python
領域
backend, devops

調査の方向性

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

  1. When conda installs a package, it rewrites the build-time path stored inside some binaries ("binary prefix replacement"). This changes their contents.
  2. 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.
  3. 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 --verify reports invalid signature (code or signature have been modified).
  4. 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 python is 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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ReactionMechanismGenerator/RMG-Py のほかの issue

ReactionMechanismGenerator/RMG-Py の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。