Intel Mac: Julia killed with "Code Signature Invalid" when loading RMS (conda leaves invalid signatures on osx-64 binaries)
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 25/100
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
- 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
- Lingua principale
- Python
- Stelle
- 550
- Fork
- 267
- Merge medio
- 8h 49m
- PR unite (30g)
- 1
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ReactionMechanismGenerator/RMG-Py
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
ReactionMechanismGenerator/RMG-Py#3044 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
ReactionMechanismGenerator/RMG-Py#3014 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
ReactionMechanismGenerator/RMG-Py#3035 ·
I maintainer di solito rispondono entro 1 giorno
-
RMS reactors: hard-coded unpreconditioned GMRES linear solver makes stiff surface/electrochemical edge simulations failForse già presa @rwest l’ha presa 29 giorni fa. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
ReactionMechanismGenerator/RMG-Py#3034 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 57/100
ReactionMechanismGenerator/RMG-Py#3030 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ReactionMechanismGenerator/RMG-Py
Issue simili
-
docs(contributing): the two things that silently block a PRForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaavailable documentation good first issue
Difficoltà 1/5 1-3 ore Idoneità per principianti 95/100
Nixitov/Riptide-Native#944 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
JTHCode/secretguard#24 ·
I maintainer di solito rispondono entro 1 giorno
-
area: middleware documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
omarelshamy25x/shamy-hijri#63 ·
I maintainer di solito rispondono entro 1 giorno