[R-sig-Geo] rgdal segmentation fault during installation

Edzer Pebesma edzer@pebe@m@ @ending from uni-muen@ter@de
Sat Nov 17 14:04:59 CET 2018


It looks like you have multiple versions of GDAL and/or PROJ installed
on your system; see https://github.com/r-spatial/sf the section on
"Multiple GDAL, GEOS and/or PROJ versions on your system" and there the
link to https://github.com/r-spatial/sf/issues/844 which contains a very
ugly solution (setting LD_LIBRARY_PATH from within R).

On 11/17/18 1:57 PM, Emanuele Cordano wrote:
> Dear list,
> 
> I got the following segmentation fault error when I try to install rgdal on
> my local Ubuntu 16.04 LTS machine. Did anyone encounter something similar?
> Please below the error message with traceback and R session info.
> Similar problems appears on
> https://stackoverflow.com/questions/50064673/cannot-install-rgdal-package-in-local-server-an-irrecoverable-exception-occurre
> which remains unsolved . In my case (see below)  all checks, PROJ4
> included,  were OK!
> 
> Thank you for any kind of feedback
> Best
> Emanuele Cordano
> 
> user using machine:~$ R
> 
> R version 3.5.1 (2018-07-02) -- "Feather Spray"
> Copyright (C) 2018 The R Foundation for Statistical Computing
> Platform: x86_64-pc-linux-gnu (64-bit)
> 
> R is free software and comes with ABSOLUTELY NO WARRANTY.
> You are welcome to redistribute it under certain conditions.
> Type 'license()' or 'licence()' for distribution details.
> 
>   Natural language support but running in an English locale
> 
> R is a collaborative project with many contributors.
> Type 'contributors()' for more information and
> 'citation()' on how to cite R or R packages in publications.
> 
> Type 'demo()' for some demos, 'help()' for on-line help, or
> 'help.start()' for an HTML browser interface to help.
> Type 'q()' to quit R.
> 
> [Previously saved workspace restored]
> 
>> install.packages("rgdal")
> Installing package into ‘/home/ecor/R/x86_64-pc-linux-gnu-library/3.5’
> (as ‘lib’ is unspecified)
> trying URL 'http://cran.r-project.org/src/contrib/rgdal_1.3-6.tar.gz'
> Content type 'application/x-gzip' length 1666975 bytes (1.6 MB)
> ==================================================
> downloaded 1.6 MB
> 
> * installing *source* package ‘rgdal’ ...
> ** package ‘rgdal’ successfully unpacked and MD5 sums checked
> configure: R_HOME: /usr/lib/R
> configure: CC: gcc -std=gnu99
> configure: CXX: g++
> configure: C++11 support available
> configure: rgdal: 1.3-6
> checking for /usr/bin/svnversion... yes
> configure: svn revision: 773
> checking for gdal-config... /usr/bin/gdal-config
> checking gdal-config usability... yes
> configure: GDAL: 2.1.3
> checking GDAL version >= 1.11.4... yes
> checking gdal: linking with --libs only... yes
> checking GDAL: /usr/share/gdal/2.1/pcs.csv readable... yes
> configure: pkg-config proj exists, will use it
> configure: PROJ version: 4.9.2
> checking proj_api.h presence and usability... yes
> checking PROJ version >= 4.8.0... yes
> checking projects.h presence and usability... yes
> checking PROJ.4: epsg found and readable... yes
> checking PROJ.4: conus found and readable... yes
> configure: Package CPP flags:  -I/usr/include/gdal
> configure: Package LIBS:  -L/usr/lib -lgdal -lproj
> configure: creating ./config.status
> config.status: creating src/Makevars
> ** libs
> g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal
> -I"/home/ecor/R/x86_64-pc-linux-gnu-library/3.5/sp/include"    -fpic  -g
> -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -g -c OGR_write.cpp -o OGR_write.o
> g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal
> -I"/home/ecor/R/x86_64-pc-linux-gnu-library/3.5/sp/include"    -fpic  -g
> -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -g -c gdal-bindings.cpp -o gdal-bindings.o
> gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal
> -I"/home/ecor/R/x86_64-pc-linux-gnu-library/3.5/sp/include"    -fpic  -g
> -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -g  -c init.c -o init.o
> gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal
> -I"/home/ecor/R/x86_64-pc-linux-gnu-library/3.5/sp/include"    -fpic  -g
> -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -g  -c inverser.c -o inverser.o
> gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal
> -I"/home/ecor/R/x86_64-pc-linux-gnu-library/3.5/sp/include"    -fpic  -g
> -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -g  -c local_stubs.c -o local_stubs.o
> g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal
> -I"/home/ecor/R/x86_64-pc-linux-gnu-library/3.5/sp/include"    -fpic  -g
> -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -g -c ogr_geom.cpp -o ogr_geom.o
> gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal
> -I"/home/ecor/R/x86_64-pc-linux-gnu-library/3.5/sp/include"    -fpic  -g
> -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -g  -c ogr_polygons.c -o ogr_polygons.o
> g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal
> -I"/home/ecor/R/x86_64-pc-linux-gnu-library/3.5/sp/include"    -fpic  -g
> -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -g -c ogr_proj.cpp -o ogr_proj.o
> g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal
> -I"/home/ecor/R/x86_64-pc-linux-gnu-library/3.5/sp/include"    -fpic  -g
> -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -g -c ogrdrivers.cpp -o ogrdrivers.o
> g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal
> -I"/home/ecor/R/x86_64-pc-linux-gnu-library/3.5/sp/include"    -fpic  -g
> -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -g -c ogrsource.cpp -o ogrsource.o
> g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I/usr/include/gdal
> -I"/home/ecor/R/x86_64-pc-linux-gnu-library/3.5/sp/include"    -fpic  -g
> -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -g -c projectit.cpp -o projectit.o
> g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions
> -Wl,-z,relro -o rgdal.so OGR_write.o gdal-bindings.o init.o inverser.o
> local_stubs.o ogr_geom.o ogr_polygons.o ogr_proj.o ogrdrivers.o ogrsource.o
> projectit.o -L/usr/lib -lgdal -lproj -L/usr/lib/R/lib -lR
> installing to /home/ecor/R/x86_64-pc-linux-gnu-library/3.5/rgdal/libs
> ** R
> ** data
> ** inst
> ** byte-compile and prepare package for lazy loading
> ** help
> *** installing help indices
> ** building package indices
> ** installing vignettes
> ** testing if installed package can be loaded
> 
>  *** caught segfault ***
> address 0x20, cause 'memory not mapped'
> 
> Traceback:
>  1: assign("has_proj_def.dat", .Call("PROJ4_proj_def_dat_Installed",
> PACKAGE = "rgdal"), envir = .RGDAL_CACHE)
>  2: fun(libname, pkgname)
>  3: doTryCatch(return(expr), name, parentenv, handler)
>  4: tryCatchOne(expr, names, parentenv, handlers[[1L]])
>  5: tryCatchList(expr, classes, parentenv, handlers)
>  6: tryCatch(fun(libname, pkgname), error = identity)
>  7: runHook(".onLoad", env, package.lib, package)
>  8: loadNamespace(package, lib.loc)
>  9: doTryCatch(return(expr), name, parentenv, handler)
> 10: tryCatchOne(expr, names, parentenv, handlers[[1L]])
> 11: tryCatchList(expr, classes, parentenv, handlers)
> 12: 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)})
> 13: library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return
> = TRUE)
> 14: withCallingHandlers(expr, packageStartupMessage = function(c)
> invokeRestart("muffleMessage"))
> 15: suppressPackageStartupMessages(library(pkg_name, lib.loc = lib,
> character.only = TRUE, logical.return = TRUE))
> 16: doTryCatch(return(expr), name, parentenv, handler)
> 17: tryCatchOne(expr, names, parentenv, handlers[[1L]])
> 18: tryCatchList(expr, classes, parentenv, handlers)
> 19: 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))})
> 20: try(suppressPackageStartupMessages(library(pkg_name, lib.loc = lib,
> character.only = TRUE, logical.return = TRUE)))
> 21: tools:::.test_load_package("rgdal",
> "/home/ecor/R/x86_64-pc-linux-gnu-library/3.5")
> An irrecoverable exception occurred. R is aborting now ...
> Segmentation fault (core dumped)
> ERROR: loading failed
> * removing ‘/home/ecor/R/x86_64-pc-linux-gnu-library/3.5/rgdal’
> 
> The downloaded source packages are in
> ‘/tmp/Rtmpq9SibK/downloaded_packages’
> Warning message:
> In install.packages("rgdal") :
>   installation of package ‘rgdal’ had non-zero exit status
>> sessionInfo()
> R version 3.5.1 (2018-07-02)
> Platform: x86_64-pc-linux-gnu (64-bit)
> Running under: Ubuntu 16.04.5 LTS
> 
> Matrix products: default
> BLAS: /usr/lib/libblas/libblas.so.3.6.0
> LAPACK: /usr/lib/lapack/liblapack.so.3.6.0
> 
> locale:
>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
>  [3] LC_TIME=en_IE.UTF-8        LC_COLLATE=en_US.UTF-8
>  [5] LC_MONETARY=en_IE.UTF-8    LC_MESSAGES=en_US.UTF-8
>  [7] LC_PAPER=en_IE.UTF-8       LC_NAME=C
>  [9] LC_ADDRESS=C               LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_IE.UTF-8 LC_IDENTIFICATION=C
> 
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
> 
> loaded via a namespace (and not attached):
> [1] compiler_3.5.1 tools_3.5.1
>>
> 

-- 
Edzer Pebesma
Institute for Geoinformatics
Heisenbergstrasse 2, 48151 Muenster, Germany
Phone: +49 251 8333081

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pEpkey.asc
Type: application/pgp-keys
Size: 2472 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20181117/02ea5a64/attachment.bin>


More information about the R-sig-Geo mailing list