[gdal-dev] OCI driver and Heap Corruption under Visual C++

Mateusz Loskot mateusz at loskot.net
Sat Aug 30 15:15:47 EDT 2008


Folks,

I'm experiencing heap corruption while calling OCIEnvCreate [1] function 
from OCI library. I build OCI driver in debug mode (with flags /D_DEBUG 
/MDd) using Visual C++ 8.0 linking against Oracle 10g Client.

The bug seems to be random, because first test I made was with minimal 
set of OGR drivers built-in. In this case OGR drivers registration 
failed with heap corruption error, precisely while deallocating string 
in this line [2].
Next, I built GDAL with default set of drivers + OCI driver
and in that case OCIEnvCreate causes heap corruption.

I spent a couple of hours debugging this issue, playing with MSVC Crt 
debugging utils, using memory checkpoints, etc. but without any 
reasonable findings, so far.

I'm interested in finding what causes this problem, so I'd be thankful 
if anyone who has experienced similar problem could report 
what/how/when/etc. here on the list, including version of Visual C++ 
compiler and compilation flags used.


[1] 
http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/oci/ogrocisession.cpp#L113

[2] 
http://trac.osgeo.org/gdal/browser/trunk/gdal/port/cpl_vsil_win32.cpp#L496

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org


More information about the gdal-dev mailing list