[gdal-dev] Potential bug with the create function for the "GTiff" driver

Adeel Raza adeel.raza at crc.gc.ca
Thu Jul 9 12:25:20 EDT 2009


Hi Frank,

I used gdalinfo.exe and it seems that the TIFF file has been created 
properly but the debugging environment is reporting the variables 
incorrectly. Thanks a lot for your help.

Best Regards,
Adeel Raza.

Frank Warmerdam wrote:
> Adeel Raza wrote:
>> Hi Frank,
>>
>> To answer your questions:
>>
>> -    " I presume you inspected the member values in the visual studio
>>    debugging environment?  I suspect you have some sort of versioning
>>    mixup - perhaps you have compiled your mainline using a different
>>    version of the include files than correctly apply to the DLL you
>>    end up invoking. "
>> Yes I did inspect the member values in the visual studio debugging 
>> environment. I'm not exactly sure what you mean by the second line, 
>> but if you mean that my DLL has been compiled from a different 
>> version of GDAL than from my import library than that is incorrect. I 
>> compiled both the import library and the DLL using the gdal 1.6.1 
>> source code and I set the MSVC_VER variable to 1500 in the 
>> "nmake.opt" file so that the "nmake /f makefile.vc" file would 
>> compile the library for the MSVC9.0.
>
> Adeel,
>
> I was suggesting any number of possible mixups though this is
> unlikely to be the case if you have one and only one version
> of GDAL on your system.
>
>> -   " Alternatively, the debugger is getting confused
>>    due to different structure packing options being used in your
>>    main project compared to what was used in building GDAL itself.  "
>> I have no idea what the structure packing options for GDAL or my 
>> project are or how to find out what they are? Any pointers in this 
>> area would be useful.
>
> I'm no expert on how visual studio handles such things.
>
>> -   "Is the created TIFF correct (if you close it)?"
>> No. I used GDALClose() to close the .tif file and then I opened it 
>> using GDALOpen() and most of the data members retained their original 
>> values except the following data members which changed to the 
>> indicated values:
>> nBands = 19036392;
>> bShared = 19076432;
>
> Please, inspect the resulting file with gdalinfo.  I assume
> the visual studio reports on GDAL objects will be wrong regardless
> of closing and opening files.
>
> In general I have learned to be suspicious of debugging environments
> ability to accurately report the contents of variables, and objects.
> Particularly when they are really "owned" by another compilation unit
> - such as coming from a DLL.  I have had bad experiences with visual
> studio and gdb/dbx on unix.
>
> Best regards,



More information about the gdal-dev mailing list