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

segmentation fault on julia 1.11 when using CondaPkg #248

Open
schlichtanders opened this issue Jan 16, 2025 · 2 comments
Open

segmentation fault on julia 1.11 when using CondaPkg #248

schlichtanders opened this issue Jan 16, 2025 · 2 comments

Comments

@schlichtanders
Copy link

schlichtanders commented Jan 16, 2025

I am unable to get the new JuliaCall 0.17.6 to work on julia 1.11. I am loading and calling it from RCall from a running julia session.

Here a minimal reproducible example. First setup a new julia Project by running julia --project=. in a new folder. Then run

ENV["JULIA_CONDAPKG_OPENSSL_VERSION"] = "ignore"  # important to ensure version 0.17.6 is actually loaded
copy!(LOAD_PATH, ["@", "@stdlib"])  # making sure no sideeffects change your setup
using CondaPkg
CondaPkg.add("r-base")
CondaPkg.add("r-juliacall")

using RCall  # RCall needs to be installed in order to set preference, will fail though if no R can be found


# make RCall use CondaPkg
# taken from https://juliainterop.github.io/RCall.jl/stable/installation/#(Experimental)-Usage-with-CondaPkg
using Libdl
using CondaPkg
using Preferences
using UUIDs

const RCALL_UUID = UUID("6f49c342-dc21-5d91-9882-a32aef131414")

CondaPkg.add("r")
target_rhome = joinpath(CondaPkg.envdir(), "lib", "R")
if Sys.iswindows()
    target_libr = joinpath(target_rhome, "bin", Sys.WORD_SIZE==64 ? "x64" : "i386", "R.dll")
else
    target_libr = joinpath(target_rhome, "lib", "libR.$(Libdl.dlext)")
end
set_preferences!(RCALL_UUID, "Rhome" => target_rhome, "libR" => target_libr)

restart julia for RCall to recompile and then run

ENV["JULIA_CONDAPKG_OPENSSL_VERSION"] = "ignore"
copy!(LOAD_PATH, ["@", "@stdlib"])  # making sure no sideeffects change your setup

using RCall
RCall.reval("library(JuliaCall)")
RCall.reval("julia_setup(installJulia=TRUE)")

which fails with the following output on my system (nixos, julia 1.11 installed via juliaup)

[106475] signal 11 (1): Segmentation fault
in expression starting at REPL[3]:1
unknown function (ip: (nil))
Allocations: 5273857 (Pool: 5273476; Big: 381); GC: 6
[1]    106475 segmentation fault (core dumped)  julia --project=.
@Non-Contradiction
Copy link
Collaborator

What is the version of R?
Does the segmentation fault still happens if JuliaCall starts in R directly and not from RCall in julia?

@schlichtanders
Copy link
Author

schlichtanders commented Jan 28, 2025

When starting from R directly the segfault does not happen.
If if starting from a Distributed.jl subprocess the segfault does not happen.

It only happens on a top-level julia process.

The R version isntalled by the above reproducible example is 4.4 on my system.

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

No branches or pull requests

2 participants