-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfault using PythonCall on Apple M1 with Julia 1.11.0-rc4 #563
Comments
I have a very similar issue with the final julia 1.11.0. The segfault is very non-deterministic. It doesn't always happen and when it happens it doesn't always happen at the same point. Some backtraces look like this:
Others like this:
Running the same code with julia 1.10.4 doesn't have this issue. |
I also get seg faults, on linux, only on multithread, in applications which worked with julia 1.10 |
Fwiw, here's a somewhat self-contained example that reliably crashes for me within a handful of runs (but it's non-deterministic), see this repository. Its only dependencies are import QuadGK
using PythonCall
const camb = pyimport("camb")
const Pm = let
params = camb.set_params(H0=70)
params.set_matter_power(redshifts=0:.1:1.5, kmax=9.5)
res = camb.get_results(params)
power = res.get_matter_power_interpolator(nonlinear=false, k_hunit=false, hubble_units=false, extrap_kmax=1e6).P
(z, k) -> let
pyval = power(z, k)
pyconvert(Float64, pyval)
end
end
calculate_stuff = (R, z) -> let
θ = R/900.
integrand = lθ -> let
kl = lθ/((1+z) * R)
sqrt(lθ)*cos(lθ)*Pm(z, kl) / (θ*θ)
end
QuadGK.quadgk(integrand, 0, 50)[1]
end
zvalues = [0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7]
Rvalues = collect(.1:.2:7.0)
@info @. calculate_stuff(Rvalues, zvalues') |
I get a segmentation error on julia v1.11.2 with another example. This is my system:
My example involves just loading HuggingFaceDatasets.jl (which uses PythonCall) from another package. It works fine if just used in a script instead. The error happens at precompilation time. julia> activate .
julia> using GNNDatasets
Precompiling GNNDatasets...
Info Given GNNDatasets was explicitly requested, output will be shown live
[68039] signal 11 (2): Segmentation fault: 11
in expression starting at none:0
_ZN3Aws4Http19CurlHandleContainerD2Ev at /Users/carlo/.julia/dev/GraphNeuralNetworks/GNNDatasets/.CondaPkg/env/lib/libaws-cpp-sdk-core.dylib (unknown line)s
Allocations: 3387461 (Pool: 3387279; Big: 182); GC: 9
✗ GNNDatasets
0 dependencies successfully precompiled in 7 seconds. 171 already precompiled.
ERROR: The following 1 direct dependency failed to precompile:
GNNDatasets
Failed to precompile GNNDatasets [2afd1aaa-255b-4d45-920d-62446192254f] to "/Users/carlo/.julia/compiled/v1.11/GNNDatasets/jl_R2rNZG".
[68039] signal 11 (2): Segmentation fault: 11
in expression starting at none:0
_ZN3Aws4Http19CurlHandleContainerD2Ev at /Users/carlo/.julia/dev/GraphNeuralNetworks/GNNDatasets/.CondaPkg/env/lib/libaws-cpp-sdk-core.dylib (unknown line)
Allocations: 3387461 (Pool: 3387279; Big: 182); GC: I can provide a full reproducer if needed. |
Affects: PythonCall
Describe the bug
I got a segfault using PythonCall on GitHub CI for Apple M1.
https://github.com/JuliaIO/ZipArchives.jl/actions/runs/11219970406/job/31187122812?pr=82
This seems to be an intermittent issue.
Your system
Additional context
Stack trace:
The text was updated successfully, but these errors were encountered: