Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault error while installing raster on macOS #63

Closed
leichtle opened this issue Jul 28, 2019 · 12 comments
Closed

Segfault error while installing raster on macOS #63

leichtle opened this issue Jul 28, 2019 · 12 comments

Comments

@leichtle
Copy link

I'm getting a segfault error installing raster on macOS.
Last working version is raster_2.5-8.

Session Info

> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.6

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.6/Resources/lib/libRlapack.dylib

Random number generation:
 RNG:     Mersenne-Twister 
 Normal:  Inversion 
 Sample:  Rounding 
 
locale:
[1] de_DE.UTF-8/de_DE.UTF-8/de_DE.UTF-8/C/de_DE.UTF-8/de_DE.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

Installation log

> install_github("rspatial/raster", force = TRUE)
Downloading GitHub repo rspatial/raster@master
✔  checking for file ‘/private/var/folders/pt/63s4hhln7_v_8z629m43xf1h0000gn/T/RtmptXORdn/remotesd0c57b91e9ab/rspatial-raster-6b29485/DESCRIPTION’ ...
─  preparing ‘raster’:
✔  checking DESCRIPTION meta-information ...
─  cleaning src
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘raster_2.9-25.tar.gz’
   
* installing *source* package ‘raster’ ...
** using staged installation
** libs
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c RasterModule.cpp -o RasterModule.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c RcppExports.cpp -o RcppExports.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c aggregate.cpp -o aggregate.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c area.cpp -o area.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c bilinear.cpp -o bilinear.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c broom.cpp -o broom.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c cellRowCol.cpp -o cellRowCol.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c clamp.cpp -o clamp.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c distance.cpp -o distance.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c edge.cpp -o edge.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c focal_fun.cpp -o focal_fun.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c focal_get.cpp -o focal_get.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c focal_sum.cpp -o focal_sum.o
/usr/bin/gcc -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe -c geodesic.c -o geodesic.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c getPolygons.cpp -o getPolygons.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c layerize.cpp -o layerize.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c memory.cpp -o memory.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c modal.cpp -o modal.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c ppmin.cpp -o ppmin.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c raster_aggregate.cpp -o raster_aggregate.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c raster_distance.cpp -o raster_distance.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c rasterize.cpp -o rasterize.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c reclass.cpp -o reclass.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c terrain.cpp -o terrain.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c util.cpp -o util.o
clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/include" -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include  -fPIC  -Wall -g -O2  -c xyCell.cpp -o xyCell.o
clang++ -std=gnu++11 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/opt/gettext/lib -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib -o raster.so RasterModule.o RcppExports.o aggregate.o area.o bilinear.o broom.o cellRowCol.o clamp.o distance.o edge.o focal_fun.o focal_get.o focal_sum.o geodesic.o getPolygons.o layerize.o memory.o modal.o ppmin.o raster_aggregate.o raster_distance.o rasterize.o reclass.o terrain.o util.o xyCell.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/3.6/Resources/library/00LOCK-raster/00new/raster/libs
** R
** inst
** byte-compile and prepare package for lazy loading
in method for ‘brick’ with signature ‘x="big.matrix"’: no definition for class “big.matrix”
in method for ‘brick’ with signature ‘x="kasc"’: no definition for class “kasc”
in method for ‘brick’ with signature ‘x="grf"’: no definition for class “grf”
in method for ‘brick’ with signature ‘x="SpatRaster"’: no definition for class “SpatRaster”
in method for ‘coerce’ with signature ‘"STFDF","RasterBrick"’: no definition for class “STFDF”
in method for ‘coerce’ with signature ‘"STSDF","RasterBrick"’: no definition for class “STSDF”
in method for ‘coerce’ with signature ‘"asc","RasterLayer"’: no definition for class “asc”
in method for ‘coerce’ with signature ‘"RasterLayer","asc"’: no definition for class “asc”
in method for ‘coerce’ with signature ‘"kasc","RasterBrick"’: no definition for class “kasc”
in method for ‘coerce’ with signature ‘"kasc","RasterStack"’: no definition for class “kasc”
in method for ‘coerce’ with signature ‘"kde","RasterLayer"’: no definition for class “kde”
in method for ‘coerce’ with signature ‘"grf","RasterBrick"’: no definition for class “grf”
in method for ‘coerce’ with signature ‘"grf","RasterLayer"’: no definition for class “grf”
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘raster’
in method for ‘extent’ with signature ‘x="sf"’: no definition for class “sf”
in method for ‘extract’ with signature ‘x="Raster",y="sf"’: no definition for class “sf”
in method for ‘mask’ with signature ‘x="Raster",mask="sf"’: no definition for class “sf”
in method for ‘raster’ with signature ‘x="big.matrix"’: no definition for class “big.matrix”
in method for ‘raster’ with signature ‘x="sf"’: no definition for class “sf”
in method for ‘raster’ with signature ‘x="kasc"’: no definition for class “kasc”
in method for ‘raster’ with signature ‘x="asc"’: no definition for class “asc”
in method for ‘raster’ with signature ‘x="kde"’: no definition for class “kde”
in method for ‘raster’ with signature ‘x="grf"’: no definition for class “grf”
in method for ‘raster’ with signature ‘x="SpatRaster"’: no definition for class “SpatRaster”
in method for ‘rasterize’ with signature ‘x="sf",y="Raster"’: no definition for class “sf”
Creating a generic function for ‘rowSums’ from package ‘base’ in package ‘raster’
Creating a generic function for ‘colSums’ from package ‘base’ in package ‘raster’
in method for ‘spplot’ with signature ‘obj="SpatRaster"’: no definition for class “SpatRaster”
in method for ‘stack’ with signature ‘x="kasc"’: no definition for class “kasc”
in method for ‘stack’ with signature ‘x="SpatRaster"’: no definition for class “SpatRaster”
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
sh: line 1: 53697 Segmentation fault: 11  '/Library/Frameworks/R.framework/Resources/bin/R' --no-save --slave 2>&1 < '/var/folders/pt/63s4hhln7_v_8z629m43xf1h0000gn/T//RtmpdeQoZq/filed1598c411d1'

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

Traceback:
 1: Module(module, mustStart = TRUE, where = env)
 2: doTryCatch(return(expr), name, parentenv, handler)
 3: tryCatchOne(expr, names, parentenv, handlers[[1L]])
 4: tryCatchList(expr, classes, parentenv, handlers)
 5: tryCatch(Module(module, mustStart = TRUE, where = env), error = function(e) e)
 6: loadModule(module = "spmod", what = TRUE, env = ns, loadNow = TRUE)
 7: (function (ns) loadModule(module = "spmod", what = TRUE, env = ns, loadNow = TRUE))(<environment>)
 8: doTryCatch(return(expr), name, parentenv, handler)
 9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
10: tryCatchList(expr, classes, parentenv, handlers)
11: tryCatch((function (ns) loadModule(module = "spmod", what = TRUE, env = ns, loadNow = TRUE))(<environment>),     error = function(e) e)
12: eval(substitute(tryCatch(FUN(WHERE), error = function(e) e),     list(FUN = f, WHERE = where)), where)
13: eval(substitute(tryCatch(FUN(WHERE), error = function(e) e),     list(FUN = f, WHERE = where)), where)
14: .doLoadActions(where, attach)
15: methods::cacheMetaData(ns, TRUE, ns)
16: loadNamespace(package, lib.loc)
17: doTryCatch(return(expr), name, parentenv, handler)
18: tryCatchOne(expr, names, parentenv, handlers[[1L]])
19: tryCatchList(expr, classes, parentenv, handlers)
20: tryCatch({    attr(package, "LibPath") <- which.lib.loc    ns <- loadNamespace(package, lib.loc)    env <- attachNamespace(ns, pos = pos, deps, exclude, include.only)}, 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)})
21: library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE)
22: withCallingHandlers(expr, packageStartupMessage = function(c) invokeRestart("muffleMessage"))
23: suppressPackageStartupMessages(library(pkg_name, lib.loc = lib,     character.only = TRUE, logical.return = TRUE))
24: doTryCatch(return(expr), name, parentenv, handler)
25: tryCatchOne(expr, names, parentenv, handlers[[1L]])
26: tryCatchList(expr, classes, parentenv, handlers)
27: 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        sm <- strsplit(conditionMessage(e), "\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 && isTRUE(getOption("show.error.messages"))) {        cat(msg, file = outFile)        .Internal(printDeferredWarnings())    }    invisible(structure(msg, class = "try-error", condition = e))})
28: try(suppressPackageStartupMessages(library(pkg_name, lib.loc = lib,     character.only = TRUE, logical.return = TRUE)))
29: tools:::.test_load_package("raster", "/Library/Frameworks/R.framework/Versions/3.6/Resources/library/00LOCK-raster/00new")
An irrecoverable exception occurred. R is aborting now ...
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/raster’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/raster’
Fehler: Failed to install 'raster' from GitHub:
  (konvertiert von Warnung) installation of package ‘/var/folders/pt/63s4hhln7_v_8z629m43xf1h0000gn/T//RtmptXORdn/filed0c57880c609/raster_2.9-25.tar.gz’ had non-zero exit status
@Marc-Girondot
Copy link

Marc-Girondot commented Dec 4, 2019

Same here with the CRAN or the development version.

No solution ?

installing to /Users/marcgirondot/Library/R/3.6/library/00LOCK-raster/00new/raster/libs
** R
** inst
** byte-compile and prepare package for lazy loading
in method for ‘brick’ with signature ‘x="big.matrix"’: no definition for class “big.matrix”
in method for ‘brick’ with signature ‘x="kasc"’: no definition for class “kasc”
in method for ‘brick’ with signature ‘x="grf"’: no definition for class “grf”
in method for ‘brick’ with signature ‘x="SpatRaster"’: no definition for class “SpatRaster”
in method for ‘coerce’ with signature ‘"STFDF","RasterBrick"’: no definition for class “STFDF”
in method for ‘coerce’ with signature ‘"STSDF","RasterBrick"’: no definition for class “STSDF”
in method for ‘coerce’ with signature ‘"asc","RasterLayer"’: no definition for class “asc”
in method for ‘coerce’ with signature ‘"RasterLayer","asc"’: no definition for class “asc”
in method for ‘coerce’ with signature ‘"kasc","RasterBrick"’: no definition for class “kasc”
in method for ‘coerce’ with signature ‘"kasc","RasterStack"’: no definition for class “kasc”
in method for ‘coerce’ with signature ‘"kde","RasterLayer"’: no definition for class “kde”
in method for ‘coerce’ with signature ‘"grf","RasterBrick"’: no definition for class “grf”
in method for ‘coerce’ with signature ‘"grf","RasterLayer"’: no definition for class “grf”
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘raster’
in method for ‘extent’ with signature ‘x="sf"’: no definition for class “sf”
in method for ‘extract’ with signature ‘x="Raster",y="sf"’: no definition for class “sf”
in method for ‘mask’ with signature ‘x="Raster",mask="sf"’: no definition for class “sf”
in method for ‘raster’ with signature ‘x="big.matrix"’: no definition for class “big.matrix”
in method for ‘raster’ with signature ‘x="sf"’: no definition for class “sf”
in method for ‘raster’ with signature ‘x="kasc"’: no definition for class “kasc”
in method for ‘raster’ with signature ‘x="asc"’: no definition for class “asc”
in method for ‘raster’ with signature ‘x="kde"’: no definition for class “kde”
in method for ‘raster’ with signature ‘x="grf"’: no definition for class “grf”
in method for ‘raster’ with signature ‘x="SpatRaster"’: no definition for class “SpatRaster”
in method for ‘rasterize’ with signature ‘x="sf",y="Raster"’: no definition for class “sf”
Creating a generic function for ‘rowSums’ from package ‘base’ in package ‘raster’
Creating a generic function for ‘colSums’ from package ‘base’ in package ‘raster’
in method for ‘spplot’ with signature ‘obj="SpatRaster"’: no definition for class “SpatRaster”
in method for ‘spplot’ with signature ‘obj="SpatVector"’: no definition for class “SpatVector”
in method for ‘stack’ with signature ‘x="kasc"’: no definition for class “kasc”
in method for ‘stack’ with signature ‘x="SpatRaster"’: no definition for class “SpatRaster”
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
sh: line 1: 11662 Segmentation fault: 11 '/Library/Frameworks/R.framework/Resources/bin/R' --no-save --slave 2>&1 < '/var/folders/1v/rfxtzxc11kj33kb8tg7znw080000gn/T//RtmpX6PMuN/file2d451134ff79'

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

Traceback:
1: Module(module, mustStart = TRUE, where = env)
2: doTryCatch(return(expr), name, parentenv, handler)
3: tryCatchOne(expr, names, parentenv, handlers[[1L]])
4: tryCatchList(expr, classes, parentenv, handlers)
5: tryCatch(Module(module, mustStart = TRUE, where = env), error = function(e) e)
6: loadModule(module = "spmod", what = TRUE, env = ns, loadNow = TRUE)
7: (function (ns) loadModule(module = "spmod", what = TRUE, env = ns, loadNow = TRUE))()
8: doTryCatch(return(expr), name, parentenv, handler)
9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
10: tryCatchList(expr, classes, parentenv, handlers)
11: tryCatch((function (ns) loadModule(module = "spmod", what = TRUE, env = ns, loadNow = TRUE))(), error = function(e) e)
12: eval(substitute(tryCatch(FUN(WHERE), error = function(e) e), list(FUN = f, WHERE = where)), where)
13: eval(substitute(tryCatch(FUN(WHERE), error = function(e) e), list(FUN = f, WHERE = where)), where)
14: .doLoadActions(where, attach)
15: methods::cacheMetaData(ns, TRUE, ns)
16: loadNamespace(package, lib.loc)
17: doTryCatch(return(expr), name, parentenv, handler)
18: tryCatchOne(expr, names, parentenv, handlers[[1L]])
19: tryCatchList(expr, classes, parentenv, handlers)
20: tryCatch({ attr(package, "LibPath") <- which.lib.loc ns <- loadNamespace(package, lib.loc) env <- attachNamespace(ns, pos = pos, deps, exclude, include.only)}, 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)})
21: library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE)
22: withCallingHandlers(expr, packageStartupMessage = function(c) invokeRestart("muffleMessage"))
23: suppressPackageStartupMessages(library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE))
24: doTryCatch(return(expr), name, parentenv, handler)
25: tryCatchOne(expr, names, parentenv, handlers[[1L]])
26: tryCatchList(expr, classes, parentenv, handlers)
27: 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 sm <- strsplit(conditionMessage(e), "\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 && isTRUE(getOption("show.error.messages"))) { cat(msg, file = outFile) .Internal(printDeferredWarnings()) } invisible(structure(msg, class = "try-error", condition = e))})
28: try(suppressPackageStartupMessages(library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE)))
29: tools:::.test_load_package("raster", "/Users/marcgirondot/Library/R/3.6/library/00LOCK-raster/00new")
An irrecoverable exception occurred. R is aborting now ...
ERROR: loading failed

  • removing ‘/Users/marcgirondot/Library/R/3.6/library/raster’
  • restoring previous ‘/Users/marcgirondot/Library/R/3.6/library/raster’
    Erreur : Failed to install 'raster' from GitHub:
    (converti depuis l'avis) installation of package ‘/var/folders/1v/rfxtzxc11kj33kb8tg7znw080000gn/T//RtmpsDUZ4R/file2ce94b8c4414/raster_3.0-7.tar.gz’ had non-zero exit status

@Marc-Girondot
Copy link

Marc-Girondot commented Jan 6, 2020

I have uninstalled R, all the libraries, Rstudio and the .R and .rstudio hidden directories. I have installed again a fresh R 3.6.2 and raster package (from binary): No more segfault when the package is loaded
I have installed again half of the packages that I had installed. I have still no problem with raster 3.0-7 package.

I try with the 3.0-10 from GitHub installed from source... and no problem !

@rhijmans
Copy link
Member

rhijmans commented Jan 6, 2020

Thanks for the update! I have been able to install on mac, and not been able to reproduce this problem. It seems painful to have to reinstall everything, but at least it is great if that make things work.

@pat-s
Copy link

pat-s commented Feb 8, 2020

Also getting a segfault when install 3.0-12 from source on macOS using gcc-9:

Details
sh: line 1: 12076 Segmentation fault: 11  '/Library/Frameworks/R.framework/Resources/bin/R' --no-save --slave 2>&1 < '/var/folders/w5/1wdhg7nd4zj7td7_pkgrl4fm0000gn/T//RtmpzJbmel/file2d1314863aef'

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

Traceback:
 1: Module(module, mustStart = TRUE, where = env)
 2: doTryCatch(return(expr), name, parentenv, handler)
 3: tryCatchOne(expr, names, parentenv, handlers[[1L]])
 4: tryCatchList(expr, classes, parentenv, handlers)
 5: tryCatch(Module(module, mustStart = TRUE, where = env), error = function(e) e)
 6: loadModule(module = "spmod", what = TRUE, env = ns, loadNow = TRUE)
 7: (function (ns) loadModule(module = "spmod", what = TRUE, env = ns, loadNow = TRUE))(<environment>)
 8: doTryCatch(return(expr), name, parentenv, handler)
 9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
10: tryCatchList(expr, classes, parentenv, handlers)
11: tryCatch((function (ns) loadModule(module = "spmod", what = TRUE, env = ns, loadNow = TRUE))(<environment>),     error = function(e) e)
12: eval(substitute(tryCatch(FUN(WHERE), error = function(e) e),     list(FUN = f, WHERE = where)), where)
13: eval(substitute(tryCatch(FUN(WHERE), error = function(e) e),     list(FUN = f, WHERE = where)), where)
14: .doLoadActions(where, attach)
15: methods::cacheMetaData(ns, TRUE, ns)
16: loadNamespace(package, lib.loc)
17: doTryCatch(return(expr), name, parentenv, handler)
18: tryCatchOne(expr, names, parentenv, handlers[[1L]])
19: tryCatchList(expr, classes, parentenv, handlers)
20: tryCatch({    attr(package, "LibPath") <- which.lib.loc    ns <- loadNamespace(package, lib.loc)    env <- attachNamespace(ns, pos = pos, deps, exclude, include.only)}, 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)})
21: library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE)
22: withCallingHandlers(expr, packageStartupMessage = function(c) invokeRestart("muffleMessage"))
23: suppressPackageStartupMessages(library(pkg_name, lib.loc = lib,     character.only = TRUE, logical.return = TRUE))
24: doTryCatch(return(expr), name, parentenv, handler)
25: tryCatchOne(expr, names, parentenv, handlers[[1L]])
26: tryCatchList(expr, classes, parentenv, handlers)
27: 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        sm <- strsplit(conditionMessage(e), "\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 && isTRUE(getOption("show.error.messages"))) {        cat(msg, file = outFile)        .Internal(printDeferredWarnings())    }    invisible(structure(msg, class = "try-error", condition = e))})
28: try(suppressPackageStartupMessages(library(pkg_name, lib.loc = lib,     character.only = TRUE, logical.return = TRUE)))
29: tools:::.test_load_package("raster", "/Users/pjs/Library/R/3.6/library/00LOCK-raster/00new")
An irrecoverable exception occurred. R is aborting now ...
ERROR: loading failed
* removing ‘/Users/pjs/Library/R/3.6/library/raster’
* restoring previous ‘/Users/pjs/Library/R/3.6/library/raster’

The downloaded source packages are in
        ‘/private/var/folders/w5/1wdhg7nd4zj7td7_pkgrl4fm0000gn/T/RtmpKCNRea/downloaded_packages’
Warning message:
In install.packages("raster") :
  installation of package ‘raster’ had non-zero exit status

@rhijmans
Copy link
Member

rhijmans commented Apr 4, 2020

It seems that a fresh install of R solves this
#86

@rhijmans rhijmans closed this as completed Apr 4, 2020
@fitzLab-AL
Copy link

fitzLab-AL commented Apr 16, 2020

@rhijmans I just did a fresh install of R (3.6.3) and it did not solve the segfault error for me (mac OS 10.15.4). Raster package installs without error, but R dies when I try to load:

library(raster)
Loading required package: sp

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

FWIW, the issue started yesterday after trying to install the canopyLazR package from github (https://github.com/akamoske/canopyLazR), which produced a segfault error on install.

@pat-s
Copy link

pat-s commented Apr 16, 2020

@fitzLab-AL Did you install R via homebrew or the official installer? (latter is recommended)

Do you have anything in ~/.R/Makevars set? If not, try the clang7 compiler from https://github.com/rmacoslib/r-macos-rtools to mirror the CRAN setup. With this, everything works smoothly for me on 10.15.4

@fitzLab-AL
Copy link

fitzLab-AL commented Apr 16, 2020

@pat-s Thanks for your reply. I did NOT use homebrew to install. I understand doing so can sometimes causes other issues.

I think my Makevars might be a bit of a mess (I made recent changes to try to get maxent to run in R):

LLVM_LOC = /usr/local/opt/llvm
#CC=$(LLVM_LOC)/bin/clang -fopenmp
#CXX=$(LLVM_LOC)/bin/clang++ -fopenmp
#O3 should be faster than -O2 (default) level optimisation ..
CFLAGS=-g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe
CXXFLAGS=-g -O3 -Wall -pedantic -std=c++11 -mtune=native -pipe
#LDFLAGS=-L/usr/local/opt/gettext/lib -L$(LLVM_LOC)/lib -Wl,-rpath,$(LLVM_LOC)/lib
CPPFLAGS=-I/usr/local/opt/gettext/include -I$(LLVM_LOC)/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include

CC=/usr/local/Cellar/gcc/9.3.0/bin/gcc-9
CXX=/usr/local/Cellar/gcc/9.3.0/bin/g++-9
CXX11=/usr/local/Cellar/gcc/9.3.0/bin/g++-9
CXX14=/usr/local/Cellar/gcc/9.3.0/bin/g++-9
cxx17=/usr/local/cellar/gcc/9.3.0/bin/g++-9
cxx1X=/usr/local/cellar/gcc/9.3.0/bin/g++-9
LDFLAGS=-L/usr/local/Cellar/gcc/9.3.0/lib

@fitzLab-AL
Copy link

@pat-s I tried the the clang7 compiler from https://github.com/rmacoslib/r-macos-rtools & no luck with that either.

@fitzLab-AL
Copy link

Finally got it to work. Steps I followed:

  1. Used the installer at https://github.com/rmacoslib/r-macos-rtools
  2. Reinstalled R
  3. Installed Rcpp
  4. Installed raster

@pat-s
Copy link

pat-s commented Apr 16, 2020

Installed Rcpp

That was probably it - Rcpp and all subsequent packages that make use of it need to be compiled with the same compiler.

In general its more safe to use clang7 or, for R 4.0, Apples system clang than gcc (due to differences in their libstdc+ implementations).

To prevent further issues you might want to use the 10.13 SDK (10.15 causes lots of issues) and add -I/usr/local/include to CPPFLAGS.

@MboiTui
Copy link

MboiTui commented Oct 19, 2020

For anyone experiencing this issue and trying to find the source of it. Or even better, wanting to avoid it.

I had the same issue as I switched compiler at some point (don't judge please), re-installed Rcpp and then all packages previously installed that make use of it broke.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants