Repository navigation
Closed as not planned
Labels
bugSomething isn't working
Description
Affects: PythonCall
Describe the bug
On M1, I can reliably induce a segfault when loading the Python package mne via PythonCall.
(@v1.9) pkg> activate --temp
Activating new project at `/var/folders/yy/nyj87tsn7093bb7d84rl64rh0000gp/T/jl_TKDOuI`
julia> versioninfo()
Julia Version 1.9.0
Commit 8e630552924 (2023-05-07 11:25 UTC)
Platform Info:
OS: macOS (arm64-apple-darwin22.4.0)
CPU: 8 × Apple M1
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1)
Threads: 1 on 4 virtual cores
(jl_TKDOuI) pkg> add CondaPkg PythonCall
Resolving package versions...
Updating `/private/var/folders/yy/nyj87tsn7093bb7d84rl64rh0000gp/T/jl_TKDOuI/Project.toml`
[992eb4ea] + CondaPkg v0.2.18
[6099a3de] + PythonCall v0.9.13
...
julia> using CondaPkg
(jl_TKDOuI) pkg> conda add mne
julia> using PythonCall
julia> pyimport("mne")
[16152] signal (11.2): Segmentation fault: 11
in expression starting at REPL[7]:1
_ZN4llvm17PMTopLevelManager16addImmutablePassEPNS_13ImmutablePassE at /private/var/folders/yy/nyj87tsn7093bb7d84rl64rh0000gp/T/jl_TKDOuI/.CondaPkg/env/lib/libLLVM-14.dylib (unknown line)
Allocations: 7988242 (Pool: 7981782; Big: 6460); GC: 13Your system
Please provide detailed information about your system:
julia> versioninfo()
Julia Version 1.9.0
Commit 8e630552924 (2023-05-07 11:25 UTC)
Platform Info:
OS: macOS (arm64-apple-darwin22.4.0)
CPU: 8 × Apple M1
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1)
Threads: 1 on 4 virtual coresAdditional context
- I suspect this might be related to Import Python submodules crashes Julia #291, but that issue lacked sufficient detail to know for sure.
- I am unable to replicate this problem with a few other related python packages (matplotlib, fooof, neurodsp) on M1.
- The issue is not present on x86-64.
- Running Python (from the
.CondaPkg/env) and importing MNE directly does not cause a segfault. - Installing MNE from pip instead of Conda resolves the issue.
I think there's some weird interaction between the Conda build, LLVM dylib and PythonCall.
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity
cjdoris commentedon Jun 2, 2023
What's the output of the
conda add mneline? I'm wondering if it's installing an incompatible version of libllvm.palday commentedon Jun 2, 2023
Here's the conda resolution
conda add mne
I had also suspected something with libllvm and it's actually installing two different versions:
palday commentedon Jul 20, 2023
There seems to be a related but distinct problem when doing this on MacOS on Intel, xref https://discourse.julialang.org/t/using-pymne-crashes-julia/101799
cjdoris commentedon Jul 27, 2023
Same version of libllvm14 as Julia.
Maybe the presence of libllvm15 as well causes issues. Why does that get installed?
Or maybe libcxx is incompatible with Julia. What is the result of
Base.BinaryPlatforms.detect_libstdcxx_version()?palday commentedon Aug 10, 2023
nothingSince we've had a few Julia patch releases in the meantime, I also tried this on 1.9.2 and 1.10-beta1 and have the same problem.
palday commentedon Aug 17, 2023
I wonder if this is related:
JuliaLang/julia#49745
palday commentedon Mar 10, 2026
I can no longer reproduce this error on 1.10 (current LTS). Closing as stale