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

Aperta
#3,037 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@rwest ci sta già lavorando.

Dal 7/11/2026.

  • #3038 di @rwest — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
julia, macos, python
Ambito
backend, devops

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Python
Stelle
550
Fork
267
Merge medio
8h 49m
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ReactionMechanismGenerator/RMG-Py

Tutte le issue di ReactionMechanismGenerator/RMG-Py

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.