Open jolars opened 3 years ago
Does it work when renv is not used?
Yes. When disabling renv it works fine.
Interestingly, I have another folder that uses renv where the issue does not occur. I have not so far been able to figure out why this doesn't happen with that project, however.
I noticed that commenting out source("renv/activate.R")
in the .Rprofile
once the errors start appearing stops the segfault loop.
Perhaps this is a naive idea, but would it be possible to invoke some exception to handling the renv activate.R
function (unless there's actually some real bug here)?
By the way, is anyone else able to reproduce this?
I guess one of the packages was not installed probably. Just removed all the renv related files and try again.
No, I just wiped R from the computer (including renv cache and all packages), and running the steps to reproduce above, I end up with exactly the same segfault.
I can reproduce this.
> sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Pop!_OS 21.04
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/atlas/libblas.so.3.10.3
LAPACK: /usr/lib/x86_64-linux-gnu/atlas/liblapack.so.3.10.3
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_NZ.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_NZ.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_NZ.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_NZ.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices datasets utils methods base
loaded via a namespace (and not attached):
[1] compiler_4.1.0 tools_4.1.0 renv_0.13.2
VS Code
Version: 1.58.2
Commit: c3f126316369cd610563c75b1b1725e0679adfb3
Date: 2021-07-14T22:30:16.440Z
Electron: 12.0.13
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Linux x64 5.11.0-7620-generic
The languageserver reports:
[2021-07-20 16:04:07.786] parse session init error 1 {
"code": 501,
"message": "R session crashed with exit code -11",
"result": null,
"stdout": "",
"stderr": "\n *** caught segfault ***\naddress 0x7fae8ed14a30, cause 'memory not mapped'\n\nTraceback:\n 1: pxlib$write_fd(as.integer(3), data)\n 2: eval(quote({ pxlib <- as.environment(\"tools:callr\")$`__callr_data__`$pxlib code_ <- 201 fd_ <- 3 text_ <- \"ready to go\" data <- paste0(code_, \" 0 \", text_, \"\\n\") pxlib$write_fd(as.integer(3), data)}), new.env())\n 3: eval(quote({ pxlib <- as.environment(\"tools:callr\")$`__callr_data__`$pxlib code_ <- 201 fd_ <- 3 text_ <- \"ready to go\" data <- paste0(code_, \" 0 \", text_, \"\\n\") pxlib$write_fd(as.integer(3), data)}), new.env())\n 4: eval(expr, p)\n 5: eval(expr, p)\n 6: eval.parent(substitute(eval(quote(expr), envir)))\n 7: local({ pxlib <- as.environment(\"tools:callr\")$`__callr_data__`$pxlib code_ <- 201 fd_ <- 3 text_ <- \"ready to go\" data <- paste0(code_, \" 0 \", text_, \"\\n\") pxlib$write_fd(as.integer(3), data)})\nAn irrecoverable exception occurred. R is aborting now ...\n",
"error": {
"message": "R session crashed with exit code -11"
}
}
A colleague of mine is also experiencing this. I'm not however, working on the same server and repository.
Looks like it is a bug of callr? Let me try if I could reproduce it.
Ah good catch, maybe its callr that needs a reinstall.
Does it occur with the latest dev of callr?
Tried for a while but cannot reproduce it.
Seems problem was related to vscode, disappeared after following these instructions: https://code.visualstudio.com/docs/remote/troubleshooting#_cleaning-up-the-vs-code-server-on-the-remote
Issue
I am getting the following error running VS Code R with the vscode-R and R-LSP extensions with a project using the renv package.
It enters an endless loop and ends up flooding my CPU.
Steps to reproduce
renv::init()
followed byinstall.packages("languageserver")
This happens both with radian and R as consoles.
System information
VS Code
sessionInfo()