Skip to content
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

Loading PyCall causes segfault on any subsequent Julia interrupt #881

Closed
marius311 opened this issue Feb 19, 2021 · 2 comments
Closed

Loading PyCall causes segfault on any subsequent Julia interrupt #881

marius311 opened this issue Feb 19, 2021 · 2 comments

Comments

@marius311
Copy link
Contributor

On this one particular system I'm using, whenever I load PyCall, any time after I try to Ctrl+C interrupt, I get a segfault. Here's e.g. a single session, the first interrupt is fine, then after loading PyCall its a segfault.

julia> inv(rand(3000,3000))
^CERROR: InterruptException:
Stacktrace:
 [1] Array
   @ ./boot.jl:448 [inlined]
 [2] getri!(A::Matrix{Float64}, ipiv::Vector{Int64})
   @ LinearAlgebra.LAPACK /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/lapack.jl:1043
 [3] inv!
   @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/lu.jl:475 [inlined]
 [4] inv(A::Matrix{Float64})
   @ LinearAlgebra /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/dense.jl:812
 [5] top-level scope
   @ REPL[1]:1

julia> using PyCall

julia> inv(rand(3000,3000))
^CFatal Python error: Segmentation fault

Current thread 0x00002aaaaab3f380 (most recent call first):

signal (11): Segmentation fault
in expression starting at none:0
raise at /lib64/libpthread.so.0 (unknown line)
_IO_funlockfile at /lib64/libpthread.so.0 (unknown line)
maybe_collect at /buildworker/worker/package_linux64/build/src/julia_threads.h:313 [inlined]
jl_gc_pool_alloc at /buildworker/worker/package_linux64/build/src/gc.c:1176
push! at ./array.jl:936 [inlined]

This is 100% reproducible, and it segfaults 100% of the time after loading PyCall. This is with PyCall 1.92.2, Julia 1.6-beta1 installed from binaries with 1 thread and Python 3.7.3 (default, Mar 27 2019, 22:11:17) [GCC 7.3.0] :: Anaconda, Inc. on linux.

Any suggestions for what I can do to try and debug this further / fix it?

@marius311
Copy link
Contributor Author

I've got an even simpler reproducer. I'm guessing its the same issue, the stack trace is identical and its also triggered by loading PyCall. Run the following with julia --threads=2:

using PyCall

Threads.@sync begin
    Threads.@spawn GC.gc(true)
    Threads.@spawn GC.gc(true)
end

Commenting out the using PyCall removes the segfault.

@stevengj
Copy link
Member

Closing in favor of #882.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants