[gdal-dev] Trying to debug a GDAL crash in "GDALClose(hDataset); "

2015-11-13 Thread Joaquim Luis
Hi, I'm having strange crashes in GDAL (SVN) when called via GMT. The crashes occur at a call to GDALClose(hDataset); Now, this is only occurs when I try to read a sub-region of a grid but those are GMT details. It doesn't happen to colleagues on OSX but they are using gdal 1.11. Can't s

Re: [gdal-dev] Trying to debug a GDAL crash in "GDALClose(hDataset); "

2015-11-13 Thread Kurt Schwehr
nLockCount should be set by https://trac.osgeo.org/gdal/browser/trunk/gdal/gcore/gdal_priv.h#L598 https://trac.osgeo.org/gdal/browser/trunk/gdal/port/cpl_atomic_ops.cpp#L56 which uses InterlockedCompareExchange to change it. Can you give the whole stack trace? On Fri, Nov 13, 2015 at 6:47 PM,

Re: [gdal-dev] Trying to debug a GDAL crash in "GDALClose(hDataset); "

2015-11-14 Thread Joaquim Luis
My bad, I don't know how to produce a stack trace from within the VS debugger. I have it all visually but find no option to save it as a file. I added a breakpoint at cpl_atomic_ops.cpp#L56 but it didn't stop there after the call to GDALClose(hDataset); Actually when stepping in it jumps

Re: [gdal-dev] Trying to debug a GDAL crash in "GDALClose(hDataset); "

2015-11-14 Thread Joaquim Luis
Ok I went ahead I tried it myself. It doesn't crash on OSX My bad, I don't know how to produce a stack trace from within the VS debugger. I have it all visually but find no option to save it as a file. I added a breakpoint at cpl_atomic_ops.cpp#L56 but it didn't stop there after the call

Re: [gdal-dev] Trying to debug a GDAL crash in "GDALClose(hDataset); "

2015-11-15 Thread Even Rouault
Le dimanche 15 novembre 2015 01:41:12, Joaquim Luis a écrit : > Ok I went ahead I tried it myself. It doesn't crash on OSX Perhaps it is an issue similar to https://trac.osgeo.org/gdal/ticket/5829 ? Several workarounds : - make sure all datasets are closed with GDALClose() before process termina

Re: [gdal-dev] Trying to debug a GDAL crash in "GDALClose(hDataset); "

2015-11-15 Thread Joaquim Luis
Even, Thanks, but this was another thing. I fixed a bug in GMT where under certain circumstances we were doing some overflowing access to the contents of the 'tmp' variable returned by GDALRasterIO(hBand, GF_Read, xOrigin, yOrigin, nXSize, nYSize, tmp,