[gdal-dev] OGR / OSEO build info

Mateusz Loskot mateusz at loskot.net
Thu May 8 17:05:40 EDT 2008


Clay, Bruce wrote:
> I added GEOS support to get OGRGrometry:Buffer support to GDAL my
> modifying the Makefile.vc. Then I called OGRRegisterAll and my program
> crashed.

Usually, to enable GEOS support you want to uncomment and edit nmake.opt
file but not any makefile.vc, see:

http://trac.osgeo.org/gdal/browser/trunk/gdal/nmake.opt?rev=14364#L305

> Environment: Windows XP, Visual Studio 2005 and GEOS 3.1.0.
> The effective stack trace follows.
> OGRRegisterAll calls VSIReadDir which calls VSIWin32FilesystemHandler 
> 
> VSIWin32FilesystemHandler calls CPLStrdup to allocate pszFileSpc.  After
> searching the directory it calls CPLFree(pszFileSpc).  
> CPLFree seems to invokde VSIFree which is shown below
> 
> void VSIFree(void *pData)
> {
>     if( pData != NULL )
>         free( pData );
> }
> 
> As soon as the free is called the program throws a
> _CrtIsValidHeapPointer(pUserData) assertion.

Sounds like de-/allocation across DLL boundaries problem

> The problem appeared to be a library compatibility issue.
> The attached GEOS seemed to get past the problem.

Ah, you edited GEOS makefile.vc.
As I see, you changed from GEOS makefile to build in debug mode.
Have you tried release mode and checked if it still crashes?

Greetings
-- 
Mateusz Loskot
http://mateusz.loskot.net


More information about the gdal-dev mailing list