I searched for this for a full day and I don't know how to find out why this happens and how to solve it.
When I run devtools::document()
on a freshly started project (a package in a new directory) in RStudio, I get a
*** caught segfault ***
address 0x18, cause 'memory not mapped'
And RStudio crashes.
Same when I try to do that from the command line.
Here is the full error:
==> devtools::document(roclets=c('rd', 'collate', 'namespace', 'vignette'))
*** caught segfault ***
address 0x18, cause 'memory not mapped'
Traceback:
1: dyn.load(file, DLLpath = DLLpath, ...)
2: library.dynam(lib, package, package.lib)
3: loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]])
4: namespaceImport(ns, loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]), from = package)
5: loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]])
6: namespaceImport(ns, loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]), from = package)
7: loadNamespace(package, ...)
8: doTryCatch(return(expr), name, parentenv, handler)
9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
10: tryCatchList(expr, classes, parentenv, handlers)
11: tryCatch(loadNamespace(package, ...), error = function(e) e)
12: requireNamespace(dep_name, quietly = TRUE)
13: check_dep_version(pkg, version, compare)
14: check_suggested("roxygen2")
15: devtools::document(roclets = c("rd", "collate", "namespace", "vignette"))
16: withCallingHandlers(expr, packageStartupMessage = function(c) invokeRestart("muffleMessage"))
17: suppressPackageStartupMessages({ oldLC <- Sys.getlocale(category = "LC_COLLATE") Sys.setlocale(category = "LC_COLLATE", locale = "C") on.exit(Sys.setlocale(category = "LC_COLLATE", locale = oldLC)) devtools::document(roclets = c("rd", "collate", "namespace", "vignette"))})
An irrecoverable exception occurred. R is aborting now ...
Exited with status 11.
And this is the result of sessionInfo()
:
> sessionInfo()
R version 3.4.2 (2017-09-28)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.5
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] magrittr_1.5 data.table_1.11.4
loaded via a namespace (and not attached):
[1] compiler_3.4.2 tools_3.4.2 yaml_2.1.19
The same happens when I use the 'document' button in the IDE.
The package can be built, but I am using Roxygen for all the imports and exports.
I have NO idea how to troubleshoot this.
Some of the options were to use devtools::clean_dll()
before document() and reinstall devtools, roxygen2, and Rcpp.
I tried all of those but nothing worked.