Ticket #3309 (closed defect: fixed)

Opened 2 years ago

Last modified 20 months ago

Change in libgeotiff broke MrSID support

Reported by: rouault Owned by: warmerdam
Priority: highest Milestone: 1.7.0
Component: default Version: unspecified
Severity: blocker Keywords: libgeotiff mrsid
Cc: hobu

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 2 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 2 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 2 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 20 months 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.

Note: See TracTickets for help on using tickets.