REditorSupport / REditorSupport/languageserver
Segfault: memory not mapped, with renv
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 675
- Forks
- 118
- Avg merge
- 1d 37m
- Merged PRs (30d)
- 11
Description
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.
[2021-06-02 13:00:30.396] parse session init error 1 {
"code": 501,
"message": "R session crashed with exit code -11",
"result": null,
"stdout": "",
"stderr": "\n *** caught segfault ***\naddress 0x7fa2bb756a40, 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"
}
}
It enters an endless loop and ends up flooding my CPU.
Steps to reproduce
- Install VS Code and the vcsode-r and vscode-r-lsp extensions
- Open a new folder in VS Code
- Open an R console and attach the vcode-r package
- run
renv::init()followed byinstall.packages("languageserver") - restart R
This happens both with radian and R as consoles.
System information
VS Code
Version: 1.56.2
Commit: 054a9295330880ed74ceaedda236253b4f39a335
Date: 2021-05-12T16:45:26.313Z
Electron: 12.0.4
Chrome: 89.0.4389.114
Node.js: 14.16.0
V8: 8.9.255.24-electron.0
OS: Linux x64 5.12.8-300.fc34.x86_64
sessionInfo()
R version 4.0.5 (2021-03-31)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Fedora 34 (Workstation Edition)
Matrix products: default
BLAS/LAPACK: /usr/lib64/libflexiblas.so.3.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=sv_SE.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=sv_SE.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.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.0.5 tools_4.0.5 jsonlite_1.7.2 rlang_0.4.11 renv_0.13.2
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported sequence with VS Code, vscode-R, vscode-r-lsp, renv::init(), and languageserver on the listed R and Fedora versions. Use the segfault trace around tools:callr and pxlib$write_fd as the starting point. Done means the R session no longer crashes or enters the reported CPU-flooding loop, with a regression check for this setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100