[gdal-dev] bug in ogrct.cpp?

Even Rouault even.rouault at spatialys.com
Fri Feb 13 09:34:30 PST 2015


Le vendredi 13 février 2015 18:08:39, Alan Stewart a écrit :
> I'm building 1.11.0 as a DLL on Windows with CPL_MULTIPROC_WIN32 and
> USE_WIN32_MUTEX defined. Everything builds fine, but in my workflow a debug
> build always fails while the release build succeeds. I'm using a modified
> version of gdalwarp.cpp as a function linked into the DLL instead of as a
> standalone executable.
> 
> The reason for the debug failure is the sole CPLAssert() in ogrct.cpp. It
> is commented out in the snippet below. The snippet begins at line 876 of
> the source file. Once commented out the debug version of my workflow seems
> to work fine, raising the question of the need for this assertion? I don't
>  know enough about ogrct.cpp or the CPL mutex to be confident about my
> decision to ignore it. Can anyone comment?
> 
> /* -------------------------------------------------------------------- */
> /*      Do the transformation using PROJ.4.                             */
> /* -------------------------------------------------------------------- */
>     if( !bIdentityTransform && pjctx == NULL )
>     {
>         /* The mutex has already been created */
>         //CPLAssert(hPROJMutex != NULL);
>         CPLAcquireMutex(hPROJMutex, 1000.0);
>     }
> 

Alan,

This would indicate there's an issue with the mutex not being created, so 
multi-threading is probably not safe. I'm not sure why mutex creation fails 
though.
Why do you define USE_WIN32_MUTEX and not use the default implementation that 
uses critical sections ?

Even


> TIA,
> 
> Alan Stewart
> Senior Software Engineer
> TerraGo Technologies
> 3200 Windy Hill Road, Suite 1550W
> Atlanta, GA 30339 USA
> O.  +1 678.391.9615
> 
> www.terragotech.com<applewebdata://B24C0762-C7C9-4431-8518-ACC915448B89/www
> .terragotech.com>

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


More information about the gdal-dev mailing list