You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am seeing the following segfault when running the following example on Julia 1.9:
$ julia -e 'using RCall; R"JuliaCall::julia_setup()"'
┌ Warning: RCall.jl: Julia version 1.9.0 at location /Users/jack/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/bin will be used.
│ Loading setup script for JuliaCall...
└ @ RCall ~/.julia/packages/RCall/LWzAQ/src/io.jl:172
┌ Warning: RCall.jl: Finish loading setup script for JuliaCall.
└ @ RCall ~/.julia/packages/RCall/LWzAQ/src/io.jl:172
[48844] signal (11.1): Segmentation fault: 11
in expression starting at none:0
ijl_eh_restore_state at /Users/jack/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line)
_atexit at ./initdefs.jl:386
jfptr__atexit_44795.clone_1 at /Users/jack/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/sys.dylib (unknown line)
ijl_apply_generic at /Users/jack/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line)
ijl_atexit_hook at /Users/jack/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line)
jl_repl_entrypoint at /Users/jack/.julia/juliaup/julia-1.9.0+0.x64.apple.darwin14/lib/julia/libjulia-internal.1.9.dylib (unknown line)
Allocations: 6538113 (Pool: 6531359; Big: 6754); GC: 10
[1] 48843 segmentation fault julia --depwarn=yes -e
If I run on Julia 1.8 or earlier, it works fine.
Based on the atexit in the stacktrace, I tried disabling the atexit hook in JuliaCall here and that made the segfault go away, so presumably there is something in that function that Julia 1.9 does not like. I haven't been able to go any deeper though
I looked a bit more into it, and it seems like the real issue is that JuliaCall should not be calling jl_atexit_hook in the case where the R session is already embedded in Julia, as Julia should be the one running its own exit hooks in that case. I'm not sure it it's possible to detect this during the initialization and if so, avoid registering the finalizer.
As a "workaround" it is possible to avoid the segfault by running empty!(Base.atexit_hooks) before the top-level Julia process exits - this is obviously a bad idea in general for many reasons, but at least can avoid the segfault if necessary
I am seeing the following segfault when running the following example on Julia 1.9:
If I run on Julia 1.8 or earlier, it works fine.
Based on the
atexit
in the stacktrace, I tried disabling the atexit hook in JuliaCall here and that made the segfault go away, so presumably there is something in that function that Julia 1.9 does not like. I haven't been able to go any deeper thoughSession Info
The text was updated successfully, but these errors were encountered: