public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* GDAL doesn't read geotiff
@ 2024-04-03  7:53 Nejia Ben Nasr
  2024-04-03  7:55 ` marco atzeri
  0 siblings, 1 reply; 4+ messages in thread
From: Nejia Ben Nasr @ 2024-04-03  7:53 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 3191 bytes --]

Hi all,

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 as folow:
$ 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

For more details about this issue I uploaded here<https://we.tl/t-XP4TPqjlmv> a small Tiff file that you can check as well as cygcheck outputs and call stack.


Thank you!



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GDAL doesn't read geotiff
  2024-04-03  7:53 GDAL doesn't read geotiff Nejia Ben Nasr
@ 2024-04-03  7:55 ` marco atzeri
  2024-04-03 17:05   ` Lemures Lemniscati
  0 siblings, 1 reply; 4+ messages in thread
From: marco atzeri @ 2024-04-03  7:55 UTC (permalink / raw)
  To: Nejia Ben Nasr; +Cc: cygwin

On Wed, Apr 3, 2024 at 9:53 AM Nejia Ben Nasr via Cygwin
<cygwin@cygwin.com> wrote:
>
> Hi all,
>
> I downloaded the last version of GDAL package.
> gdalinfo on any tiff file give "Segmentation fault".
>

noted.
Not sure when I can look on it

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GDAL doesn't read geotiff
  2024-04-03  7:55 ` marco atzeri
@ 2024-04-03 17:05   ` Lemures Lemniscati
  2024-04-04 23:04     ` Lemures Lemniscati
  0 siblings, 1 reply; 4+ messages in thread
From: Lemures Lemniscati @ 2024-04-03 17:05 UTC (permalink / raw)
  To: cygwin

On Wed, 3 Apr 2024 09:55:33 +0200, marco atzeri via Cygwin
> On Wed, Apr 3, 2024 at 9:53 AM Nejia Ben Nasr via Cygwin
> <cygwin@cygwin.com> wrote:
> >
> > Hi all,
> >
> > I downloaded the last version of GDAL package.
> > gdalinfo on any tiff file give "Segmentation fault".
> >
> 
> noted.
> Not sure when I can look on it

	
It might be a situation in which libgeotiff 1.7.1-2 is linked to an old
libtiff6 4.4.0-1 [1]. Rebuilding libgeotiff packages would resolve it.
Please, note that current libtiff is libtiff7 4.5.1-1 [2].

[1]; https://cygwin.com/packages/summary/libgeotiff5.html
[2]; https://cygwin.com/packages/summary/libtiff7.html

Lem


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: GDAL doesn't read geotiff
  2024-04-03 17:05   ` Lemures Lemniscati
@ 2024-04-04 23:04     ` Lemures Lemniscati
  0 siblings, 0 replies; 4+ messages in thread
From: Lemures Lemniscati @ 2024-04-04 23:04 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1985 bytes --]

On Thu, 04 Apr 2024 02:05:10 +0900, Lemures Lemniscati
> On Wed, 3 Apr 2024 09:55:33 +0200, marco atzeri via Cygwin
> > On Wed, Apr 3, 2024 at 9:53 AM Nejia Ben Nasr via Cygwin
> > <cygwin@cygwin.com> wrote:
> > >
> > > Hi all,
> > >
> > > I downloaded the last version of GDAL package.
> > > gdalinfo on any tiff file give "Segmentation fault".
> > >
> > 
> > noted.
> > Not sure when I can look on it
> 
> 	
> It might be a situation in which libgeotiff 1.7.1-2 is linked to an old
> libtiff6 4.4.0-1 [1]. Rebuilding libgeotiff packages would resolve it.
> Please, note that current libtiff is libtiff7 4.5.1-1 [2].
> 
> [1]; https://cygwin.com/packages/summary/libgeotiff5.html
> [2]; https://cygwin.com/packages/summary/libtiff7.html
> 

I've confirmed that rebuilding with libgeotiff.cygport (attached to this
mail) can avoid segmentation fault while running gdalinfo on tiff files.
But some tests have failed.

--- libgeotiff-1.7.1-2.src/libgeotiff.cygport	2022-07-05 11:39:27.000000000 +0900
+++ libgeotiff-1.7.1-3.src/libgeotiff.cygport	2024-04-05 07:33:41.279743900 +0900
@@ -1,6 +1,6 @@
 NAME="libgeotiff"
 VERSION=1.7.1
-RELEASE=2
+RELEASE=3
 
 CATEGORY="Graphics Libs"
 DESCRIPTION="GeoTIFF represents an effort by over 160 different
@@ -12,11 +12,13 @@
 HOMEPAGE="https://trac.osgeo.org/geotiff/"
 SRC_URI="https://download.osgeo.org/geotiff/libgeotiff/${PN}-${PV}.tar.gz" 
 SRC_DIR="${PN}-${PV}"
+LICENSE="MIT"
 
 # PATCH_URI="libgeotiff-build.patch"
 
 PKG_NAMES="libgeotiff libgeotiff-devel libgeotiff5"
-BUILD_REQUIRES="libproj-devel libtiff-devel"
+BUILD_REQUIRES="libproj-devel libtiff-devel proj"
+# proj is required to test, though it is unnecessary to build.
 
 libgeotiff_CONTENTS='usr/bin/*.exe usr/share'
 libgeotiff_SUMMARY="${SUMMARY} - utilities"  



* Note: cyggdal-34.dll depends on cygpoppler-106.dll, which dpends on 
cygtiff-6.dll, which is an older binary (latest is cygtiff-7.dll).
So, it would be better to rebuilding poppler packages, too.

Lem

[-- Attachment #2: libgeotiff.cygport --]
[-- Type: application/octet-stream, Size: 1322 bytes --]

NAME="libgeotiff"
VERSION=1.7.1
RELEASE=3

CATEGORY="Graphics Libs"
DESCRIPTION="GeoTIFF represents an effort by over 160 different
remote sensing, GIS, cartographic, and surveying related
companies and organizations to establish a TIFF based
interchange format for georeferenced raster imagery."

SUMMARY="georeferenced raster imagery"
HOMEPAGE="https://trac.osgeo.org/geotiff/"
SRC_URI="https://download.osgeo.org/geotiff/libgeotiff/${PN}-${PV}.tar.gz" 
SRC_DIR="${PN}-${PV}"
LICENSE="MIT"

# PATCH_URI="libgeotiff-build.patch"

PKG_NAMES="libgeotiff libgeotiff-devel libgeotiff5"
BUILD_REQUIRES="libproj-devel libtiff-devel proj"
# proj is required to test, though it is unnecessary to build.

libgeotiff_CONTENTS='usr/bin/*.exe usr/share'
libgeotiff_SUMMARY="${SUMMARY} - utilities"  

libgeotiff_devel_CONTENTS='usr/lib/libgeotiff.dll.a usr/include'
libgeotiff_devel_SUMMARY="${SUMMARY} - development libraries"

libgeotiff5_CONTENTS='usr/bin/cyggeotiff-5.dll'
libgeotiff5_SUMMARY="${SUMMARY} - shared libraries"


DIFF_EXCLUDES="Makefile geo_config.h"
KEEP_LA_FILES="none"

src_compile() {
	cd ${S}
    	cygautoreconf
	cd ${B}
	cygconf --enable-shared \
		--disable-static \
		--with-zip \
		--with-jpeg \
		--with-proj
	cygmake 
}

src_test() {
	cd ${B}
	cygmake -i check
}

src_install() {
	cd ${B}
	cyginstall 
}

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-04-04 23:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-03  7:53 GDAL doesn't read geotiff Nejia Ben Nasr
2024-04-03  7:55 ` marco atzeri
2024-04-03 17:05   ` Lemures Lemniscati
2024-04-04 23:04     ` Lemures Lemniscati

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).