1

I'm getting two different error messages when attempting to load packages using the 'require' or 'library' functions in R 3.4.1. Since the problem has started, I've only been able to load one package (ggplot2), while others (including any phylogenetics-oriented package, e.g. ape) cause the following error:

*** caught segfault ***
address 0x0, cause 'memory not mapped'

Traceback:
 1: getDLLRegisteredRoutines.DLLInfo(dll, addNames = FALSE)
 2: assignNativeRoutines(dlls[[lib]], lib, env, nsInfo$nativeRoutines[[lib]])
 3: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]])
 4: asNamespace(ns)
 5: namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc,     .libPaths()), versionCheck = vI[[j]]), i[[2L]], from = package)
 6: loadNamespace(package, lib.loc)
 7: doTryCatch(return(expr), name, parentenv, handler)
 8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
 9: tryCatchList(expr, classes, parentenv, handlers)
10: tryCatch({    attr(package, "LibPath") <- which.lib.loc    ns <- loadNamespace(package, lib.loc)    env <- attachNamespace(ns, pos = pos, deps)}, error = function(e) {    P <- if (!is.null(cc <- conditionCall(e)))         paste(" in", deparse(cc)[1L])    else ""    msg <- gettextf("package or namespace load failed for %s%s:\n %s",         sQuote(package), P, conditionMessage(e))    if (logical.return)         message(paste("Error:", msg), domain = NA)    else stop(msg, call. = FALSE, domain = NA)})
11: library(ape)

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace

[EDIT: The following error was resolved, see first comment below] When I try to load the package rJava, I get the following error. Other packages that give similar errors:

library(rJava)
Error: package or namespace load failed for ‘rJava’:
 .onLoad failed in loadNamespace() for 'rJava', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/Users/dummyname/R_libs/rJava/libs/rJava.so':
  dlopen(/Users/dummyname/R_libs/rJava/libs/rJava.so, 6): Library not loaded: @rpath/libjvm.dylib
  Referenced from: /Users/dummyname/R_libs/rJava/libs/rJava.so
  Reason: image not found

I've tried uninstalling all packages, as suggested here: caught segfault error in R I also re-installed R. The same error appears after reinstalling packages. Session info is below the error message. Suggestions?

> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: OS X El Capitan 10.11.6

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.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     

loaded via a namespace (and not attached):
[1] compiler_3.4.1
kashoz
  • 11
  • 2
  • I've resolved the second of the two errors in the question above using the line: 'sudo ln -f -s $(/usr/libexec/java_home)/jre/lib/server/libjvm.dylib /usr/local/lib' from [this SO answer](https://stackoverflow.com/questions/30738974/rjava-load-error-in-rstudio-r-after-upgrading-to-osx-yosemite). – kashoz Jul 28 '17 at 15:24
  • Trying to load ape from source showed there was a library compatibility problem with gfortran. I got errors like this: ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0' when trying to load ape. I tried the solution here for Mac OS Sierra (I updated after initial post to see if that would clarify anything or help), with no luck: http://thecoatlessprofessor.com/programming/rcpp-rcpparmadillo-and-os-x-mavericks-lgfortran-and-lquadmath-error/ Temporary solution to uninstall R 3.4 and re-install R 3.3. – kashoz Jul 29 '17 at 00:50

0 Answers0