[gdal-dev] GDAL under cygwin doesn't read geotiff

Nejia Ben Nasr nbennsasr at luxcarta.com
Wed Apr 3 02:39:10 PDT 2024


Hi,

I downloaded the last version of GDAL package.
gdalinfo on any tiff file give "Segmentation fault".

$ gdalinfo --version
GDAL 3.8.3, released 2024/01/04

$ gdalinfo test.tif --config CPL_DEBUG ON
GDAL: GDALOpen(test.tif, this=0xa000bbe70) succeeds as GTiff.
Driver: GTiff/GeoTIFF
Segmentation fault


CALL STACK:
cygtiff-6.dll!cygtiff-6!TIFFUnlinkDirectory (Unknown Source:0)
cygwin1.dll!bsearch(const void * key, const void * base, size_t nmemb, size_t size, int (*)(const void *, const void *) compar) (c:\cygwin64\usr\src\debug\cygwin-3.5.0-1\newlib\libc\search\bsearch.c:79)
cygtiff-6.dll!cygtiff-6!TIFFFindField (Unknown Source:0)
cygtiff-6.dll!cygtiff-6!TIFFVGetField (Unknown Source:0)
cygtiff-6.dll!cygtiff-6!TIFFGetField (Unknown Source:0)
cyggeotiff-5.dll!_GTIFGetField(tiff_t * tif, pinfo_t tag, int * count, void * val) (c:\cygwin64\usr\src\debug\libgeotiff-1.7.1-2\geo_tiffp.c:86)
cyggeotiff-5.dll!GTIFNewWithMethodsEx(void * tif, TIFFMethod * methods, GTErrorCallback error_callback, void * user_data) (c:\cygwin64\usr\src\debug\libgeotiff-1.7.1-2\geo_new.c:133)
cyggeotiff-5.dll!GTIFNewEx(void * tif, GTErrorCallback error_callback, void * user_data) (c:\cygwin64\usr\src\debug\libgeotiff-1.7.1-2\geo_new.c:84)
cyggdal-34.dll!GTiffDataset::GTIFNew(TIFF * hTIFF) (c:\cygwin64\usr\src\debug\gdal-3.8.3-1\frmts\gtiff\gtiffdataset.cpp:1613)
cyggdal-34.dll!GTiffDataset::LoadGeoreferencingAndPamIfNeeded(GTiffDataset * const this) (c:\cygwin64\usr\src\debug\gdal-3.8.3-1\frmts\gtiff\gtiffdataset_read.cpp:5833)
cyggdal-34.dll!GTiffRasterBand::GetMetadataItem(GTiffRasterBand * const this, const char * pszName, const char * pszDomain) (c:\cygwin64\usr\src\debug\gdal-3.8.3-1\frmts\gtiff\gtiffrasterband_read.cpp:1532)
cyggdal-34.dll!GDALRasterBand::GetStatistics(GDALRasterBand * const this, int bApproxOK, int bForce, double * pdfMin, double * pdfMax, double * pdfMean, double * pdfStdDev) (c:\cygwin64\usr\src\debug\gdal-3.8.3-1\gcore\gdalrasterband.cpp:4316)


I also tried to build from sources but it fail:
$ cmake .. \
   -DCMAKE_BUILD_TYPE=Release \
   -DCMAKE_INSTALL_PREFIX=/cygdrive/d/gdal-release-3.8/install \
   -DGDAL_USE_INTERNAL_LIBS=ON \
   -DGDAL_USE_EXTERNAL_LIBS=OFF \
   -DGDAL_BUILD_OPTIONAL_DRIVERS=OFF \
   -DOGR_BUILD_OPTIONAL_DRIVERS=OFF

$ make

In file included from /usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/map:60,
                 from /cygdrive/d/gdal-release-3.8/gcore/gdal_priv.h:7,
                 from /cygdrive/d//gdal-release-3.8/apps/gdalinfo_lib.cpp:55:
/usr/lib/gcc/x86_64-pc-cygwin/11/include/c++/bits/stl_tree.h:350:1: error: expected unqualified-id before numeric constant
  350 | 1      _Rb_tree_const_iterator(const iterator& __it) _GLIBCXX_NOEXCEPT
      | ^
make[2]: *** [apps/CMakeFiles/appslib.dir/build.make:76: apps/CMakeFiles/appslib.dir/gdalinfo_lib.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:3038: apps/CMakeFiles/appslib.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

Is there a Cmake option that I shoud add?

Thank you for you help!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240403/8b1a92e3/attachment-0001.htm>


More information about the gdal-dev mailing list