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

Segmentation Fault with terra::buffer(rast) in Docker Container #1585

Open
azomorod opened this issue Aug 15, 2024 · 0 comments
Open

Segmentation Fault with terra::buffer(rast) in Docker Container #1585

azomorod opened this issue Aug 15, 2024 · 0 comments

Comments

@azomorod
Copy link

azomorod commented Aug 15, 2024

Hi
First of all thanks a lot for the brilliant work on developing terra. it's a game changer in the field.
I am using a simple docker image as below to run a script on an EC2 instance (The EC2 instance has sufficient memory and CPU resources) with ubuntu OS:

FROM rocker/geospatial
RUN apt-get update -qq && apt-get install -y --no-install-recommends \
  libssl-dev \
  libudunits2-dev \
  libgdal-dev \
  gdal-bin \
  libgeos-dev \
  libproj-dev \
  libsqlite3-dev \
  && apt-get clean

RUN R -e "install.packages(c('terra','raster','fasterize','wk','cleangeo','sf','snowflake', 'gdalUtilities'))"

using this image I will get:

> packageVersion("terra")
[1] ‘1.7.78’
> terra::gdal(lib="all")
    gdal     proj     geos 
 "3.4.1"  "8.2.1" "3.10.2" 

now whenever I use the terra::buffer() on a raster layer in my script in the docker container, it returns a memory map error (it works fine on my local machine with the macOS 14.4 M1 Pro and

terra::gdal(lib="all")
gdal proj geos
"3.5.3" "9.1.0" "3.11.0"
packageVersion("terra")
[1] ‘1.7.78’) :

# Error Message: When running the following code in the Docker container:
terra::buffer(tile_raster_new, width = 250)

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

Traceback:
 1: .External(list(name = "CppMethod__invoke_notvoid", address = <pointer: 0x5c959f1177f0>,     dll = list(name = "Rcpp", path = "/usr/local/lib/R/site-library/Rcpp/libs/Rcpp.so",         dynamicLookup = TRUE, handle = <pointer: 0x5c95a20a04c0>,         info = <pointer: 0x5c959f903bb0>, forceSymbols = FALSE),     numParameters = -1L), <pointer: 0x5c95a36c5c40>, <pointer: 0x5c95a3b18090>,     .pointer, ...)
 2: x@ptr$buffer(width, background, opt)
 3: .local(x, ...)
 4: terra::buffer(tile_raster_new, width = 250)

Could you please provide any insights or suggestions on how to resolve this issue?

Thank you!

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

1 participant