There are several reports for this issue all dating 2 to 3 years back:
Most of them are referring to older system versions and older ggplot2 version. I'm wondering if anybody found alternative solution to the suggested R re-installation (which apparently did not work for everyone)?
I'm on Mac 10.11.6 and when trying to install ggplot2 either from within or outside of R (R CMD INSTALL) I get segfault:
*** caught segfault ***
address 0x18, cause 'memory not mapped'
The same can be reproduced using ggplot2 versions:
1.0.0, 1.0.1, 2.0.0, 2.1.0, 2.2.0
I tested that on fresh R-3.3.2 session. The error occurs during installation, not during loading.
Traceback received:
 Traceback:
 1: dyn.load(file, DLLpath = DLLpath, ...)
 2: library.dynam(lib, package, package.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(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]])
 7: namespaceImport(ns, loadNamespace(i, c(lib.loc, .libPaths()),     versionCheck = vI[[i]]), from = package)
 8: loadNamespace(package, lib.loc, keep.source, partial = TRUE)
 9: withCallingHandlers(expr, packageStartupMessage = function(c) invokeRestart("muffleMessage"))
10: suppressPackageStartupMessages(loadNamespace(package, lib.loc,     keep.source, partial = TRUE))
11: code2LazyLoadDB(package, lib.loc = lib.loc, keep.source = keep.source,     compress = compress)
12: makeLazyLoading(pkg_name, lib, keep.source = keep.source)
13: doTryCatch(return(expr), name, parentenv, handler)
14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
15: tryCatchList(expr, classes, parentenv, handlers)
16: tryCatch(expr, error = function(e) {    call <- conditionCall(e)    if (!is.null(call)) {        if (identical(call[[1L]], quote(doTryCatch)))             call <- sys.call(-4L)        dcall <- deparse(call)[1L]        prefix <- paste("Error in", dcall, ": ")        LONG <- 75L        msg <- conditionMessage(e)        sm <- strsplit(msg, "\n")[[1L]]        w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")        if (is.na(w))             w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L],                 type = "b")        if (w > LONG)             prefix <- paste0(prefix, "\n  ")    }    else prefix <- "Error : "    msg <- paste0(prefix, conditionMessage(e), "\n")    .Internal(seterrmessage(msg[1L]))    if (!silent && identical(getOption("show.error.messages"),         TRUE)) {        cat(msg, file = stderr())        .Internal(printDeferredWarnings())    }    invisible(structure(msg, class = "try-error", condition = e))})
17: try({    suppressPackageStartupMessages(.getRequiredPackages(quietly = TRUE))    makeLazyLoading(pkg_name, lib, keep.source = keep.source)})
18: do_install_source(pkg_name, instdir, pkg, desc)
19: do_install(pkg)
20: tools:::.install_packages()
An irrecoverable exception occurred. R is aborting now ...
/Users/username/miniconda3/lib/R/bin/INSTALL: line 34:  2049 Done                    echo 'tools:::.install_packages()'
      2050 Segmentation fault: 11  | R_DEFAULT_PACKAGES= LC_COLLATE=C "${R_HOME}/bin/R" $myArgs --slave --args ${args}
The reproduce, start new R session and install 'ggplot2' with:
$ R
> install.packages('ggplot2')
Session info:
> sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin11.4.2 (64-bit)
Running under: OS X 10.11.6 (El Capitan)
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 
Any suggestions would be appreciated.
 
    