[Gdal-dev] crash ( access violation ) in GDAL when trying to read a TIFF

Stephane Routelous route at cae.com
Thu Sep 2 10:27:50 EDT 2004


Hi Andrey,

I got the daily cvs snapshot (gdal-cvs-20040902), recompiled it in debug,
and still got the same problem.
Here is my test code :
int main(int argc, char* argv[])
{
	GDALAllRegister();
	GDALDataset* m_gdalDataSet = (GDALDataset *) GDALOpen(
"C:\\TestDB\\cramps-tile.tif", GA_ReadOnly );  //this is line 15
	cout << m_gdalDataSet->GetRasterXSize() << " " <<
m_gdalDataSet->GetRasterYSize() << endl;
	GDALClose(m_gdalDataSet);
	return 0;
}

I hope the following information will be usefull :
Thnaks a lot,

Stephane

And here is what Boundchecker says (2 errors : Allocation conflict and
memory overrun):


1/ Allocation Conflict:


Type				Quantity			Location
Sequence

Allocation conflict	1				VSIRealloc -
[cpl_vsisimple.cpp, line 332 (gdal12.dll)]		20
Allocation Conflict: Attempting to call realloc on pointer 0x1F28C08, that
was allocated by HeapAlloc.

Current Call Stack
VSIRealloc			cpl_vsisimple.cpp			332
_TIFFrealloc		tif_vsi.c				184
TIFFMergeFieldInfo	tif_dirinfo.c			309
GTiffTagExtender		geotiff.cpp				3695
XTIFFDefaultDirectory	xtiff.c				85
TIFFDefaultDirectory	tif_dir.c				1144
TIFFReadDirectory		tif_dirread.c			200
TIFFClientOpen		tif_open.c				387
TIFFOpen			tif_vsi.c				161
XTIFFOpen			xtiff.c				138
Open				geotiff.cpp				2042
GDALOpen			gdalopen.cpp			228
main				C:\GDALBuild\test\test.cpp	15
mainCRTStartup		crtexe.c				338
	C:\WINNT\system32\KERNEL32.dll!0x00011af3	

Call Stack At Allocation
_heap_alloc	C:\GDALBuild\bin\gdal12.dll!0x0000006c	
_nh_malloc	C:\GDALBuild\bin\gdal12.dll!0x0000000b	
malloc	C:\GDALBuild\bin\gdal12.dll!0x0000000a	
_TIFFmalloc			tif_vsi.c				172



2/ memory overrun


Type			Quantity	Location
Sequence

Overrun detected	1		VSIRealloc - [cpl_vsisimple.cpp,
line 332 (gdal12.dll)]	21
Overrun Detected During Execution: In block 0x1F28C08 (400) allocated by
HeapAlloc.

Current Call Stack
VSIRealloc			cpl_vsisimple.cpp
332
_TIFFrealloc		tif_vsi.c					184
TIFFMergeFieldInfo	tif_dirinfo.c				309
GTiffTagExtender		geotiff.cpp
3695
XTIFFDefaultDirectory	xtiff.c					85
TIFFDefaultDirectory	tif_dir.c					1144
TIFFReadDirectory		tif_dirread.c				200
TIFFClientOpen		tif_open.c					387
TIFFOpen			tif_vsi.c
161
XTIFFOpen			xtiff.c					138
Open				geotiff.cpp
2042
GDALOpen			gdalopen.cpp				228
main				C:\GDALBuild\test\test.cpp		15
mainCRTStartup		crtexe.c					338
	C:\WINNT\system32\KERNEL32.dll!0x00011af3	

Call Stack At Allocation
_heap_alloc	C:\GDALBuild\bin\gdal12.dll!0x0000006c	
_nh_malloc	C:\GDALBuild\bin\gdal12.dll!0x0000000b	
malloc	C:\GDALBuild\bin\gdal12.dll!0x0000000a	
_TIFFmalloc	tif_vsi.c	172




More information about the Gdal-dev mailing list