JuliaInterop / RCall.jl

Call R from Julia
Other
317 stars 59 forks source link

Segfault when loading R units package in a task #431

Open ianfiske opened 3 years ago

ianfiske commented 3 years ago

If I load the R package units within a julia task, then Julia crashes with a segfault.

using RCall

@async begin
   R"library(units)"
end

then Julia crashes with a segfault error. See https://github.com/julia-vscode/julia-vscode/issues/2299 for a bit of background and in particular https://gist.github.com/ianfiske/c18cc4c2dd64f45922b40a7c7f536732 for the lldb stacktrace.

I am on Julia 1.6.2, OSX 11.4, R 4.1.0, RCall 0.13.12.

This issue manifests by crashing within VSCode since the Julia extension there uses tasks (I think).

(Update: Initially this was reported as triggered by the R package sf, but the underlying crash is actually from loading units, a dependency package of sf).

alunap commented 2 years ago

Was there ever an answer to this? I also get the segfault trying to load any R library in VSCode via RCall. Not just sf, though, I get a crash with tidyverse or arrow or anything else. I tried setting R_HOME and recompiling RCall, but that didn't help. I am on an intel iMac running Monterey 12.5. Julia v1.8.0, R v4.2.0. First time I've tried using RCall, although I use PyCall all the time successfully. Correction: digging around I saw the R installed by anaconda was in my .zshenv LD_LIBRARY_PATH. When I removed that, I could load tidyverse and arrow, but sf fails in the same way.

simonbyrne commented 2 years ago

I suspect it's #444: I don't have the time to do this, but am happy to review if someone else wants to take it on.

palday commented 1 month ago

On Julia 1.10 + RCall 0.14.2 + R 4.4.1, I get this segfault even without the use of tasks.