GDAL/ogr2ogr/ogrinfo produces an invalid pointer error each time I run it

1.2k Views Asked by At

After installing ogr2ogr following the steps described here https://mothergeo-py.readthedocs.io/en/latest/development/how-to/gdal-ubuntu-pkg.html

When I run either ogr2ogr or ogrinfo, I get the following error message

free(): invalid pointer

AFTER the execution of the command. Any advice to clean that?

ogrinfo --version GDAL 3.3.2, released 2021/09/01 free(): invalid pointer Aborted (core dumped)

-- Edit --

I may have found some kind of tip here. mail-archive.com/[email protected]/msg36151.htmllibproj

Excerpt :

so your GDAL is linking against 2 PROJ versions libproj.so.15 and libproj.so.19. Make sure your libspatialite and libgeotiff versions are from the ubuntugis PPA, so they link gainst libproj.so.19 and no .so.15

Now I need to find a way to remove one library, without breaking my os...

1

There are 1 best solutions below

1
On

There's a bug regarding linking against 2 PROJ versions libproj.so.15 and libproj.so.19

For Debian/Ubuntu, you can do to remedy it

sudo apt purge gdal-bin -y
sudo rm -f /lib/x86_64-linux-gnu/libproj.so.15
sudo ln -s /lib/x86_64-linux-gnu/libproj.so.19 /lib/x86_64-linux-gnu/libproj.so.15
sudo apt install gdal-bin -y