For anyone else who runs into this issue its a version mismatch problem, As
gdal-config was saying my system has moved on to GDAL 3.3.2 but looking at
the output of the failing tests showed that GeoTools was still picking up
version 3.0.4 somehow.

ldconfig -p | grep gdal
libgdalalljni.so.29 (libc6,x86-64) => /usr/local/lib/libgdalalljni.so.29
libgdal.so.29 (libc6,x86-64) => /usr/local/lib/libgdal.so.29
libgdal.so.29 (libc6,x86-64) => /usr/lib/libgdal.so.29
libgdal.so.26 (libc6,x86-64) => /usr/lib/libgdal.so.26
libgdal.so (libc6,x86-64) => /usr/local/lib/libgdal.so
libgdal.so (libc6,x86-64) => /usr/lib/libgdal.so

so the 26 shared library was being picked up first.

The solution was to set /usr/local/lib ahead of /usr/lib in LD_LIBRARY_PATH
- I didn't want to just delete the 26 version of the library as something
else might need it.

Ian

On Fri, 27 May 2022 at 12:08, Ian Turton <ijtur...@gmail.com> wrote:

> I'm seeing a persistent failure when I try to build main locally, it's in
> gt-imageio-ext-gdal.
>
> There's a dumpstream in the surefire-reports folder that says:
>
> # Created at 2022-05-27T11:57:21.448
> free(): invalid pointer
>
> # Created at 2022-05-27T11:57:21.456
> Aborted
>
> And the failing tests seems to be VRTTest, RPFTOCTest & SRPTest with this
> error:
>
>
> -------------------------------------------------------------------------------
> Test set: org.geotools.coverageio.gdal.vrt.VRTTest
>
> -------------------------------------------------------------------------------
> Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 s <<<
> FAILURE! - in org.geotools.coverageio.gdal.vrt.VRTTest
> test(org.geotools.coverageio.gdal.vrt.VRTTest)  Time elapsed: 0 s  <<<
> ERROR!
> java.lang.NoClassDefFoundError: Could not initialize class
> org.gdal.gdalconst.gdalconstConstants
>         at
> it.geosolutions.imageio.gdalframework.GDALImageReader.setInput(GDALImageReader.java:703)
>         at javax.imageio.ImageReader.setInput(ImageReader.java:380)
>         at
> org.geotools.coverageio.BaseGridCoverage2DReader.<init>(BaseGridCoverage2DReader.java:161)
>         at
> org.geotools.coverageio.gdal.BaseGDALGridCoverage2DReader.<init>(BaseGDALGridCoverage2DReader.java:74)
>         at
> org.geotools.coverageio.gdal.vrt.VRTReader.<init>(VRTReader.java:54)
>         at org.geotools.coverageio.gdal.vrt.VRTTest.test(VRTTest.java:102)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:498)
>
> While DTEDTest fails with:
>
> Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.049 s
> <<< FAILURE! - in org.geotools.coverageio.gdal.dted.DTEDTest
> test(org.geotools.coverageio.gdal.dted.DTEDTest)  Time elapsed: 0.047 s
>  <<< ERROR!
> java.lang.UnsatisfiedLinkError:
> org.gdal.gdalconst.gdalconstJNI.OF_MULTIDIM_RASTER_get()I
>         at org.gdal.gdalconst.gdalconstJNI.OF_MULTIDIM_RASTER_get(Native
> Method)
>         at
> org.gdal.gdalconst.gdalconstConstants.<clinit>(gdalconstConstants.java:101)
>         at
> it.geosolutions.imageio.gdalframework.GDALImageReader.setInput(GDALImageReader.java:703)
>         at javax.imageio.ImageReader.setInput(ImageReader.java:380)
>         at
> org.geotools.coverageio.BaseGridCoverage2DReader.<init>(BaseGridCoverage2DReader.java:161)
>         at
> org.geotools.coverageio.gdal.BaseGDALGridCoverage2DReader.<init>(BaseGDALGridCoverage2DReader.java:74)
>         at
> org.geotools.coverageio.gdal.dted.DTEDReader.<init>(DTEDReader.java:53)
>         at
> org.geotools.coverageio.gdal.dted.DTEDTest.test(DTEDTest.java:75)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:498)
>
> gdal-config --version reports 3.3.2 and I'm running Ubuntu 20.04 LTS.
>
> Can anyone see what might be up?
>
> Ian
>
> --
> Ian Turton
>


-- 
Ian Turton
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to