Skip to content

segmentation fault on julia 1.11 when using CondaPkg #248

Open
@schlichtanders

Description

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=.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions