[gdal-dev] bug in ogrct.cpp?
Even Rouault
even.rouault at spatialys.com
Fri Feb 13 10:50:22 PST 2015
Le vendredi 13 février 2015 19:43:17, Alan Stewart a écrit :
> I'm assuming any "*WIN32*" define should be used when building for Windows.
> I'll certainly try without that one. Is there documentation I have not
> found for GDAL defines? I certainly don't understand the practical
> significance of CPL_MULTIPROC_STUB, CPL_MULTIPROC_WIN32 and
> CPL_MULTIPROC_PTHREADS.
You shouldn't have to mess with any define directly. You just need to look at
nmake.opt and edit directly into it or create a nmake.local
>
> 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
>
> -----Original Message-----
> From: Even Rouault [mailto:even.rouault at spatialys.com]
> Sent: Friday, February 13, 2015 12:35 PM
> To: gdal-dev at lists.osgeo.org
> Cc: Alan Stewart
> Subject: Re: [gdal-dev] bug in ogrct.cpp?
>
> 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 ?
>
> Since we have disabled the main() function in gdalwarp.cpp (before my
> involvement), possibly there is something there that normally causes the
> mutex to be created before this point in the code. I will investigate that
> also.
>
> 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-ACC915448B8
> > 9/www
> > .terragotech.com>
>
> --
> Spatialys - Geospatial professional services http://www.spatialys.com
--
Spatialys - Geospatial professional services
http://www.spatialys.com
More information about the gdal-dev
mailing list