-
Notifications
You must be signed in to change notification settings - Fork 59
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
Error C stack usage too close to the limit (when precompiling w Julia 1.2) #289
Comments
I have seen this error before in other context when the R engine was running in a second thread. Not sure if it’s related here. |
if you're suggesting that it may be because I was running R at the same time, this does not seem to be the case (I just retried now making sure that there was zero active R processes). |
No. It wasn't what I meant. It seems that the new version of Julia is compiling RCall in a second thread and R doesn't like to be running in a second thread. |
I have this in 1.1 |
But it works on 1.0 |
I could also reproduce it with macOS + julia 1.2-dev. Rhome = readchomp(`R RHOME`)
ENV["R_HOME"] = Rhome
ENV["R_DOC_DIR"] = joinpath(Rhome,"doc")
ENV["R_INCLUDE_DIR"] = joinpath(Rhome,"include")
ENV["R_SHARE_DIR"] = joinpath(Rhome,"share")
const libR = Rhome * "/lib/libR.dylib" # mac
# const libR = Rhome * "/lib/libR.so" # linux
argv = ["REmbeddedJulia","--silent","--no-save"]
ccall((:Rf_initEmbeddedR,libR),Cint,(Cint,Ptr{Ptr{Cchar}}),length(argv),argv) Definitely caused by a change in upstream code. |
Everything works fine if we use JuliaCall to start an embedded Julia in R, and then use RCall inside the embedded Julia, since we don't have to start embedded R in this way. And I also have some interesting observation:
So a stack error appears again when we try to use RCall after we start a Julia REPL, but is totally fine without a Julia REPL. I don't know if the two errors are related. |
Inspired by the last example, I also tried something like this:
So using RCall non-interactively is also fine. I guess the problem is related to REPL, event loop or something like that. |
Great discovery. It must be because now the events are being processed asynchronously. |
But it doesn’t explain why my code example above fails. |
Given that 1.1 is going to be out any day this is likely to get a lot of attention soon. |
Unfortunately, I don't really have a clue on how to fix the issue. |
Can anyone confirm that the same issue occurs on Windows? |
I have started a discussion at julia forum: https://discourse.julialang.org/t/initialization-of-r-fails-on-julia-1-1/19735 Hope we will be able to get some help for julia dev. |
The issue is that Julia no longer loads libraries in the main thread, which interacts badly with R's design. It should be possible to work around this according to these instructions: |
But it doesn’t explain why it works in the non-interactive environment. |
It probably has something to do with |
Is there any Windows user to verify whether this bug also affects them? |
I have similar, probably related issue with Windows 10, Julia 1.1.0 and R-devel (2019-01-24 r76013) (also happened with older R version, 3.5.1 I think), and latest Atom and related packages. This does not happen all the time though. Basically I am running some MCMC simulations, and afterwards I have
and with fresh session this works, but if I try to use
edit: But now after closing Rstudio and opening it again, I don't see the error anymore... |
Hey, just adding my 2c here, I have the same issue running Julia 1.1 and RCall on macOS 10.14.2 (18C54). In my case, I can't run
I am running Julia inside a Jupyter notebook, so I guess my only option is using it interactively. I also tried overwriting
to no avail. EDIT: I can confirm that this does not seem to be a problem with Julia 1.0. |
I can confirm the fix works for me on Julia 1.1 on macOS 10.14.2 |
@randy3k it seems to work fine for me, thanks 👍 |
same issue here with |
for now |
and run |
Great guys!! thank you very much! As I don't quite understand what those two commands mean, and in general have trouble to understand the github/version/commit system but I'm very eager to learn as much as I can about Julia, and github, could you advise me a tutorial link as a good starting point to learn about those topics (I know it is not related to RCall anymore and the question is quite broad but if you have any link in mind I would really appreciate!). Many thanks @mkborregaard and @randy3k |
So, essentially Simon Byrne made a fix and put it in a "branch" of the repository, which just means a version of the repository that is not yet official. The name of that branch is "sb/stack". The guys behind RCall wanted to make sure that it actually did solve everybodys problems before putting it in the default branch (called "master") and releasing it out to all the RCall users out there. Pkg in Julia allows users to use other branches than the default one. The other command |
* Fix for C stack checking issues on 1.1 Fixes #289. * C stack fix for Windows Co-authored-by: Randy Lai <randy.cs.lai@gmail.com>
Many thanks @mkborregaard. That really helped a lot! |
Hello, I added RCall today and:
(I tried this twice, it failed both time with a similar error)
version info
Edit:
I tried this with a couple of versions:
The text was updated successfully, but these errors were encountered: