RCall.jl icon indicating copy to clipboard operation
RCall.jl copied to clipboard

Segfault when loading R units package in a task

Open ianfiske opened this issue 4 years ago • 3 comments

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

ianfiske avatar Aug 24 '21 13:08 ianfiske

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.

alunap avatar Sep 02 '22 14:09 alunap

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.

simonbyrne avatar Sep 02 '22 15:09 simonbyrne