Opened 8 years ago

Closed 5 years ago

#6542 closed defect (wontfix)

Wrong libtool -version-info in gdal-2.1.0 (trunk as well).

Reported by: vblazek Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: default Version: 2.1.0
Severity: normal Keywords:
Cc:

Description

We've been using gdal-2.0.2 for some time but since I've run into a memory problem that dissapeared after trying gdal-2.1.0 we've upgraded to this new version.

Unfortunatelly, upgraded library version has ended up with the same SONAME libgdal.so.20. This leads to a replacement of original library from 2.0.2 with new code from 2.1.0 that happens to be binary incompatible: anything linked against libgdal.so.20 from 2.0.2 crashes. It seems that C++ classes on the interface have different layout.

After digging in the sources I've found that version of library in GDALmake.opt.in (variable CURRENT) is set to 21 -> the library should be named libgdal.so.21. But it is not.

The problem is that variable AGE has been set to 1; this tells libtool that library implements interfaces 20 and 21 and the library is therefore still named libgdal.so.20.

It would not be a problem with a library with pure C interface. However, in the case of C++ library any change of any class on the interface (i.e. the class that is used in both user and library code, like GDALDataset) can (and usually will) cause user code to use different class layout (member offsets and virtual table) from changed library code.

Please, since libgdal has public C++ interace do not use libtool's AGE part of -version-info and keep it always 0.

Change History (2)

comment:1 by Bas Couwenberg, 8 years ago

The libtool version-info is correct for the GDAL C API, unfortunately the C++ API is not provided by a separate library, requiring rebuilds of all reverse dependencies that rely on the C++ API for every new GDAL release. This has been a known issue for new GDAL releases for quite some time, and is not going to change by using libtool differently.

Basing the libtool version-info on the C++ API makes more sense than not using the AGE part, because the libtool versioning is used correctly (but only for the C API).

Discussion about this issue is happening on the gdal-dev list, see the thread starting at: http://lists.osgeo.org/pipermail/gdal-dev/2016-June/044583.html

comment:2 by Even Rouault, 5 years ago

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.

Note: See TracTickets for help on using tickets.