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
Bus Error on Radian Launch #439
Comments
I get the same error but specifically with the usethis package when I type Radian version:
Other packages work fine with the namespace, and usethis works fine in the base R console (with |
For me, it is happening in a non-renv environment. > R
R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
...
R> requireNamespace('renv')
Loading required namespace: renv
Failed with error: ‘there is no package called ‘renv’’
R> grep('R_|renv', names(Sys.getenv()), ignore.case=T, value=T)
[1] "__CF_USER_TEXT_ENCODING" "R_ARCH"
[3] "R_BROWSER" "R_BZIPCMD"
[5] "R_DOC_DIR" "R_GZIPCMD"
[7] "R_HOME" "R_INCLUDE_DIR"
[9] "R_LIBS_SITE" "R_LIBS_USER"
[11] "R_MAX_VSIZE" "R_PAPERSIZE"
[13] "R_PDFVIEWER" "R_PLATFORM"
[15] "R_PRINTCMD" "R_QPDF"
[17] "R_RD4PDF" "R_SESSION_TMPDIR"
[19] "R_SHARE_DIR" "R_STRIP_SHARED_LIB"
[21] "R_STRIP_STATIC_LIB" "R_SYSTEM_ABI"
[23] "R_TEXI2DVICMD" "R_UNZIPCMD"
[25] "R_ZIPCMD" "USER_ZDOTDIR"
R> q()
Save workspace image? [y/n/c]: n
~/
> radian
*** caught bus error ***
address 0x100c4e6d0, cause 'invalid alignment'
.... |
I can also replicate this behaviour with these radian specs:
A couple of observations:
I can, however, launch radian and R from the terminal and it works as normal. I can also initiate an renv project - however some packages will then throw the same error as above. Adding this line: I also have these settings in vs-code:
|
Update: this isn't a great workaround as you can't send code from the editor to the terminal out of the box.
|
I think this is a I'm using R 4.3 installed by rig.
I receive no error if I run without radian:
|
This is a radian error. It does not happen with R alone, but it does happen with Radian It occurs when loading packages. For me, it happens with packages pdftools, qpdf, rJava, tabulizer, tablulizerjars These are all packages that I installed this morning. Packages I installed over the last 4 months still work. I installed a new Python version yesterday (from python.org), v3.12.0, but radian has been and is running under asdf python version 3.11.3 previously. It still crashes if I reinstall the R packages under radian or reinstall under standalone R session It still crashes after uninstalling and reinstalling radian, using both pip and pipx I love radian! Hope this helps |
There is a high chance that the python c runtime and R c time has some collision. You will have a better chance of success if you install both R and python using the same environment. |
@aswansyahputra how did you install R? Since you are using homebrew python, please make sure that you are also using homebrew R. |
I just tried radian with homebrew python and the official arm64 R on M2 mac. Everything is working fine.. |
Ai, maybe it is not obvious enough, please make sure that both python, R and R packages are arm64. |
@randy3k I downloaded and installed the R binary from the official page (I also have R installed in my other machine installed using rig), unfortunately the problem also happening there. |
Unfortunately, that does not work on my m2. I tried with the homebrew python and r ( |
I just tested @randy3k's statement about Homebrew R and Python being the same. I was having this issue when I had the Homebrew cask, but when I installed from the Homebrew formula, the error seems to have disappeared. I recommend others try this out. If your R executable (in I was running into the issue when radian would look for the exported members for autocompletion, specifically with cmdstanr. I thought that since cmdstanr has an external dependency it was the issue, but then rmarkdown had a problem. I wonder if there's some relationship to external libraries that could be hosing the dylib lookup? This has the assumption that your Python is managed by Homebrew as well! |
Thank everyone, but especially @psanker 's last comment. My problem was that I was using the R install from R foundation. Uninstalling that, and |
What if I want to use radian on MacOS with pyenv and rig, which enables using multiple versions of Python and R? I use pyenv to compile and install Python and rig to maintain multiple versions of R. I need to support multiple versions of Python and R for my projects and it would be great to find a way to be able to leverage radian in these situations. |
From the rchitect FAQ, it looks like you'll need to manually set the Looking at the source, rchitect looks at |
Thanks. I can confirm that this works on my machine. |
Setting R_HOME to point to R 4.3.1 installed using rig does not fix the problem for me. @randy3k any ideas would be greatly appreciated! Here is an example loading dplyr from R 4.3.1 in rig. R_HOME is:
Now starting radian with R_HOME set, I get the bus error:
I have a
|
Setting If it helps give any clues: reinstalling problematic packages from source makes the issue goes away (e.g., using renv, |
I think the error occurs on L22 in
init.R
of vscode-r:https://github.com/REditorSupport/vscode-R/blob/70e3267c88052c8f299363719c18c776bdab139c/R/session/init.R#L22
Show Error
Radian version
> radian --version radian version: 0.6.7 r executable: /Library/Frameworks/R.framework/Resources/bin/R r version: 4.3.1 python executable: /opt/homebrew/opt/python@3.11/bin/python3.11 python version: 3.11.6
The text was updated successfully, but these errors were encountered: