Ticket #3309 (reopened defect)

Opened 3 years ago

Last modified 6 months ago

Change in libgeotiff broke MrSID support

Reported by: rouault Owned by: warmerdam
Priority: high Milestone:
Component: GDAL_Raster Version: unspecified
Severity: major Keywords: libgeotiff mrsid gtiff
Cc: hobu, kirk

Description

I have fought the whole day long trying to understand why I got constant crashes when reading .sid files (environmenet : Fedora 12 32 bit, GCC 4.4.2, Geo_DSDK-7.0.0.2167, internal libtiff & libgeotiff), for example on autotest/gdrivers/data/mercator.sid

It finally turns out that the addition of the DefnSet? field in GTIFDefn structure (geo_normalize.h) was the cause ( http://trac.osgeo.org/geotiff/changeset/1641 and refreshed from upstream libgeotiff in r18007). This is a change in the ABI. From the symbols needed by libltidsdk.a, I see that GTIFGetDefn() is used. So, as a variable of type struct GTIFDefn can only be allocated by the caller, the addition of the DefnSet? field likely causes some internal state of the mrsid binary to be overwritten which yields to the crash.

So what are the options ? Reverting the addition of DefnSet? field ? In any event, for the future, it might be sane to add an allocator/deallocator for the GTifDefn structure and urge people to use it if we might add new fields.

Change History

Changed 3 years ago by warmerdam

I agree that libgeotiff 1.3.0 (and the internal version) are ABI incompatible with what the mrsid sdk expects. I *think* this is not a problem on windows where the libgeotiff presumably included in the dsdk should be used by it.

I have clarified the abi change in 1.3.0 within libgeotiff ( http://trac.osgeo.org/geotiff/ticket/19).

I do not see this ticket as a blocker, nor do I see any further action other than making the issue clear for those building mrsid support.

Changed 3 years ago by rouault

  • status changed from new to closed
  • resolution set to fixed

r18431 /trunk/gdal/NEWS: Add a warning about incompatibility between MrSID GeoDSDK and libgeotiff 1.3.0

http://trac.osgeo.org/gdal/wiki/MrSID?action=diff&version=7 : Add note for MrSID and ABI incompatibilities with libgeotiff 1.3.0 or …

Changed 3 years ago by mrosen

LT is tracking the need for an updated MrSID SDK internally. The defect number is 10663. I don't have a targeted release date for the community at this time.

Changed 3 years ago by kmckelvey

We have addressed this internally for our next release of the MrSID SDK, however any future changes to the GTIFDefn struct will result in similar failure. The problem is that we allocate GTIFDefn (or put it on the stack). We should be letting libgeotiff create this for us but I could not find an interface for it. We need a GTIFCreateGTIFDefn() or something. Should I open a feature request or does this already exist somewhere? I would like to address this permanently if possible.

Changed 7 months ago by warmerdam

  • priority changed from highest to high
  • status changed from closed to reopened
  • resolution fixed deleted
  • severity changed from blocker to major

Reopening as there is now a problem with the newer version of libgeotiff with TOWGS84 parameters in the GTIFDefn structure.

Changed 7 months ago by warmerdam

Integrate support for libgeotiff 1.4.1 GTIFDefn alloc/free in trunk (r25085).

Changed 7 months ago by warmerdam

Integrate support for GEO_NORMALIZE_DISABLE_TOWGS84 libgeotiff directive for binary compatability in trunk (r25086) and 1.9 branch (r25087).

Changed 7 months ago by warmerdam

Implied in the above, I have made the following changes in libgeotiff for 1.4.1 release.

2012-10-08 Frank Warmerdam <warmerdam@…>

  • geo_normalize.c/geo_normalize.h: Add support for disabling the TOWGS84 parameter support if GEO_NORMALIZE_DISABLE_TOWGS84 is defined. This is primary intended to maintain binary compatability of the GTIFDefn structure with older versions (for MrSID compat for instance). No configure support - you need to manually incorporate into geo_config.h or perhaps geo_normalize.h. (gdal #3309)
  • geo_normalize.c/geo_normalize.h: Add GTIFAllocDefn() and GTIFFreeDefn() functions for allocation/free of GTIF structure in a more version independent way.

The GEO_NORMALIZE_DISABLE_TOWGS84 change should make it possible to build libgeotiff in a way that is binary compatability with MrSID SDK (such as DSDK 7.0.0).

Changed 7 months ago by warmerdam

  • keywords gtiff added
  • component changed from default to GDAL_Raster

Changed 6 months ago by kirk

  • cc kirk added
Note: See TracTickets for help on using tickets.