[gdal-dev] Segmentation fault (core dumped) occurs when running ogr2ogr command on container

寛座 智大 tomohiro.kanza.306 at baycurrent.co.jp
Tue Mar 5 22:20:15 PST 2024


Abel Pau,

Hi. Thank you for your response.

>I reduced this capacity 10 times and it worked.
Does this mean you reduced the size of the Shape file?
Or does it mean that you reduced the amount of memory requested?
( If it's the latter, I'd like to learn how to do it.)

Shape files are typically around 4MB, so I don't consider them to be very large files.
Additionally, I tried it on an AKS with a free memory size of over 20GB, but encountered the same issue.
It seems unlikely that there is a lack of specifications in the execution environment.

Could the issue possibly be due to a bug in the command?

From: Abel Pau <a.pau at creaf.uab.cat>
Sent: Monday, March 4, 2024 4:57 PM
To: 寛座 智大 <tomohiro.kanza.306 at baycurrent.co.jp>
Subject: RE: Segmentation fault (core dumped) occurs when running ogr2ogr command on container

Hi,
I did similar tests with a driver I am implementing and I obtained exact the same behavior as yours.
After a few speculations I deduced that my driver was asking for too much memory for the docker capacity.
I reduced this capacity 10 times and it worked.
So, perhaps, Shape or Geojson asks for too much memory for the docker capacity.
I don’t know if it’s possible to make it bigger.

Abel.

De: gdal-dev <gdal-dev-bounces at lists.osgeo.org<mailto:gdal-dev-bounces at lists.osgeo.org>> En nombre de ?? ?? via gdal-dev
Enviado el: dilluns, 4 de març de 2024 3:30
Para: gdal-dev at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org>
Asunto: [gdal-dev] Segmentation fault (core dumped) occurs when running ogr2ogr command on container


I am implementing batch processing to convert Shape files, publicly available as open data,

into Geojson format within a container environment.



I installed gdal-bin on top of ubuntu:22.04 base image.

The Dockerfile I implemented is as follows:

```

FROM ubuntu:22.04



ENV DEBIAN_FRONTEND=noninteractive

RUN apt update

RUN apt -y install apt-transport-https jq unzip openjdk-17-jdk-headless curl



# Install gdal-bin

# Reference: https://mothergeo-py.readthedocs.io/en/latest/development/how-to/gdal-ubuntu-pkg.html#how-to-install-gdal-ogr-packages-on-ubuntu

RUN apt -y install software-properties-common

RUN add-apt-repository -y ppa:ubuntugis/ppa

RUN apt update

RUN apt -y install gdal-bin



COPY ./convert.sh /convert.sh



CMD ["bash","convert.sh"]

```



When executing the ogr2ogr command within convert.sh, the following error occurs:

```

Shape: DBF Codepage = SJIS for /d1.shp

Shape: Treating as encoding 'MS932'.

GDAL: GDALOpen(/d1.shp, this=0x55f1edd77f30) succeeds as ESRI Shapefile.

GDAL: QuietDelete(/d1_raw.geojson) invoking Delete()

GDAL: GDALDriver::Create(GeoJSON,/d1_raw.geojson,0,0,0,Unknown,(nil))

GDALVectorTranslate: 5315 features written in layer 'd1'

Shape: 5315 features read on layer 'd1'.

GDAL: GDALClose(/d1.shp, this=0x55f1edd77f30)

GDAL: GDALClose(/d1_raw.geojson, this=0x55f1edd75fd0)

GDAL: In GDALDestroy - unloading GDAL shared library.

Segmentation fault (core dumped)

```



I checked if convert.sh execution is possible on the VM (host OS running Docker).

The error seems to occur only when executed within the container.



How should I resolve this?



※Environment

Host OS: ubuntu 22.04

Docker Deamon: 25.0.3

gdal-bin: 3.6.4

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240306/6f504a61/attachment-0001.htm>


More information about the gdal-dev mailing list