OSGeo/gdal-grass

Undefined symbol runtime error w/GDAL 3.5.1

ssinno opened this issue · 4 comments

Compiles fine against GDAL 3.5.1, but hitting undefined symbol errors with any kind of execution, which go away if I simply remove the GRASS plugins. My guess is a simple update is req to reflect changes in 3.5.1

  gdalinfo --version
    ERROR 1: /discover/swdev/sacs/sw/base/gcc12-3.5.1/gdal-3.5.1/lib/gdalplugins/ogr_GRASS.so: undefined symbol: _ZNK11GDALDataset19GetFieldDomainNamesB5cxx11EPKPKc
    ERROR 1: /discover/swdev/sacs/sw/base/gcc12-3.5.1/gdal-3.5.1/lib/gdalplugins/ogr_GRASS.so: undefined symbol: _ZNK11GDALDataset19GetFieldDomainNamesB5cxx11EPKPKc
    ERROR 1: /discover/swdev/sacs/sw/base/gcc12-3.5.1/gdal-3.5.1/lib/gdalplugins/gdal_GRASS.so: undefined symbol: _ZNK11GDALDataset19GetFieldDomainNamesB5cxx11EPKPKc
    ERROR 1: /discover/swdev/sacs/sw/base/gcc12-3.5.1/gdal-3.5.1/lib/gdalplugins/gdal_GRASS.so: undefined symbol: _ZNK11GDALDataset19GetFieldDomainNamesB5cxx11EPKPKc
    GDAL 3.5.1, released 2022/06/30

Wild guess, might it be related to OSGeo/gdal#5152
?

Wild guess, might it be related to OSGeo/gdal#5152

yes and no, it looks more like the plugin is built against GDAL 3.5 headers but run against an older GDAL library. Look at the output of "ldd /discover/swdev/sacs/sw/base/gcc12-3.5.1/gdal-3.5.1/lib/gdalplugins/ogr_GRASS.so" to check which GDAL runtime library is linked.

Looks like it's linking to the correct (3.5.1) rev of the source-obj(as part of LD_LIBRARY_PATH), and appears to be finding all that it's looking for, but the issue persists

(sacs-3.5.1) [ssinno@discover23 gdalplugins]ldd -v gdal_GRASS.so| egrep '(gdal|not found)'
        libgdal.so.31 => /discover/swdev/sacs/sw/sacs-3.5.1/gdal-3.5.1/lib/libgdal.so.31 (0x00007ffff5ee6000)
        ./gdal_GRASS.so:
        /discover/swdev/sacs/sw/sacs-3.5.1/gdal-3.5.1/lib/libgdal.so.31:
(sacs-3.5.1) [ssinno@discover23 gdalplugins]ldd -v ogr_GRASS.so| egrep '(gdal|not found)'
        libgdal.so.31 => /discover/swdev/sacs/sw/sacs-3.5.1/gdal-3.5.1/lib/libgdal.so.31 (0x00007ffff5ee6000)
        /discover/swdev/sacs/sw/sacs-3.5.1/gdal-3.5.1/lib/libgdal.so.31:
(sacs-3.5.1) [ssinno@discover23 gdalplugins]gdalinfo --version
ERROR 1: /discover/swdev/sacs/sw/base/gcc12-3.5.1/gdal-3.5.1/lib/gdalplugins/ogr_GRASS.so: undefined symbol: _ZNK11GDALDataset19GetFieldDomainNamesB5cxx11EPKPKc

I attempted the same on an entirely new & different system in AWS(Ubuntu LTS 20.04, as opposed to prior SLES12), and gcc9 instead of gcc12, no other GDAL libraries on the entire systsem, and...exact same results. I'd wager this is trivially reproduceable on any system.

[ssinno@nasaAWS gdal-grass-1.0.1]gdalinfo --version
ERROR 1: /shared/sacs/sw/base/gcc9-3.5.1/gdal-3.5.1/lib/gdalplugins/ogr_GRASS.so: undefined symbol: _ZNK11GDALDataset19GetFieldDomainNamesB5cxx11EPKPKc
ERROR 1: /shared/sacs/sw/base/gcc9-3.5.1/gdal-3.5.1/lib/gdalplugins/ogr_GRASS.so: undefined symbol: _ZNK11GDALDataset19GetFieldDomainNamesB5cxx11EPKPKc
ERROR 1: /shared/sacs/sw/base/gcc9-3.5.1/gdal-3.5.1/lib/gdalplugins/gdal_GRASS.so: undefined symbol: _ZNK11GDALDataset19GetFieldDomainNamesB5cxx11EPKPKc
ERROR 1: /shared/sacs/sw/base/gcc9-3.5.1/gdal-3.5.1/lib/gdalplugins/gdal_GRASS.so: undefined symbol: _ZNK11GDALDataset19GetFieldDomainNamesB5cxx11EPKPKc
GDAL 3.5.1, released 2022/06/30