[gdal-dev] Exception in GDALAllRegister()

Even Rouault even.rouault at spatialys.com
Thu Sep 13 09:19:00 PDT 2018


On jeudi 13 septembre 2018 08:32:27 CEST FA wrote:
> I have built GDAL.lib as a static library for Win32 using Visual C++ 2017.
> The library uses std-lib Tools\MSVC\14.15.26726
> 
> Using an "empty" test application, I experience a crash in GDALAllRegister,
> more precisely a NULL pointer dereferencing in xtree when
> GDALAddDerivedBandPixelFunc("real", RealPixelFunc) executes
> osMapPixelFunction[pszFuncName] = pfnNewFunction;
> 
> 	template<class _Other>
> 		_Nodeptr _Lbound(const _Other& _Keyval) const
> 		{	// find leftmost node not less than _Keyval
> 		_Nodeptr _Wherenode = this->_Get_data()._Myhead;	// end() if search 
fails
> 
> >>>		_Nodeptr _Pnode = _Wherenode->_Parent;
> 
> because _Wherenode is NULL.
> 
> Does anyone know if this could be due to an incompatibility between GDAL and
> the VC version of the std-lib?

This might perhaps be due to incompatible runtime options used to compile GDAL 
and your application. Particularly if you compiled GDAL 2.2 or earlier in 
debug mode where it used /MD by default and not /MDd (this has changed 
starting with GDAL 2.3)

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list