[gdal-dev] gdalwarp crash when reading

Andrew Brooks arb at sat.dundee.ac.uk
Fri Sep 19 05:01:02 EDT 2008


Hello

gdalwarp is crashing and dumping core, my command line is:

gdalwarp -tps -t_srs EPSG:23031 -r bilinear -tr 1000 100 input.vrt output.tif

where the vrt references a raw binary (uint16) array and two raw float arrays
of latitude and longitude.

Maybe the stack backtrace will indicate something obvious to someone?
For example should pBuffer=0 in RawRasterBand::Read ??

#0  0xb731a1ba in memcpy () from /lib/tls/libc.so.6
#1  0xb730dc06 in _IO_file_xsputn () from /lib/tls/libc.so.6
#2  0xb730eac8 in _IO_sgetn () from /lib/tls/libc.so.6
#3  0xb7302f20 in fread () from /lib/tls/libc.so.6
#4  0xb7bf2199 in VSIUnixStdioHandle::Read (this=0xb10d5000, pBuffer=0x0,
     nSize=1, nCount=2) at cpl_vsil_unix_stdio_64.cpp:169
#5  0xb7bf118a in VSIFReadL (pBuffer=0x0, nSize=1, nCount=2, fp=0xb10d5000)
     at cpl_vsil.cpp:423
#6  0xb7b437af in RawRasterBand::Read (this=0xb10d5000, pBuffer=0x0, nSize=0,
     nCount=0) at rawdataset.cpp:842
#7  0xb7b4399e in RawRasterBand::AccessLine (this=0x8075408, iLine=0)
     at rawdataset.cpp:228
#8  0xb7b43ae0 in RawRasterBand::IReadBlock (this=0x8075408, nBlockXOff=0,
     nBlockYOff=0, pImage=0xa0889c8) at rawdataset.cpp:276
#9  0xb7bd94e8 in GDALRasterBand::GetLockedBlockRef (this=0x8075408,
     nXBlockOff=0, nYBlockOff=0, bJustInitialize=0) at gdal_priv.h:335
#10 0xb7be5b40 in GDALRasterBand::IRasterIO (this=0x8075408, eRWFlag=GF_Read,
     nXOff=0, nYOff=0, nXSize=1009, nYSize=1029, pData=0xb10dd008,
     nBufXSize=1009, nBufYSize=1029, eBufType=GDT_UInt16, nPixelSpace=2,
     nLineSpace=2018) at rasterio.cpp:89

Andrew


P.S.  The input VRT is

<VRTDataset rasterXSize="2048" rasterYSize="1021">
   <Metadata domain="GEOLOCATION">
     <MDI key="X_DATASET">input.lon.vrt</MDI>
     <MDI key="X_BAND">1</MDI>
     <MDI key="Y_DATASET">input.lat.vrt</MDI>
     <MDI key="Y_BAND">1</MDI>
     <MDI key="PIXEL_OFFSET">0</MDI>
     <MDI key="LINE_OFFSET">0</MDI>
     <MDI key="PIXEL_STEP">1</MDI>
     <MDI key="LINE_STEP">1</MDI>
   </Metadata>
   <SRS>GEOGCS[&quot;WGS 72&quot;,DATUM[&quot;WGS_1972&quot;,SPHEROID[&quot;WGS 72&quot;,6378135,298.26,AUTHORITY[&quot;EPSG&quot;,&quot;7043&quot;]],AUTHORITY[&quot;EPSG&quot;,&quot;6322&quot;]],PRIMEM[&quot;Greenwich&quot;,0,AUTHORITY[&quot;EPSG&quot;,&quot;8901&quot;]],UNIT[&quot;degree&quot;,0.01745329251994328,AUTHORITY[&quot;EPSG&quot;,&quot;9122&quot;]],AUTHORITY[&quot;EPSG&quot;,&quot;4322&quot;]]</SRS>
   <VRTRasterBand dataType="UInt16" band="1" subClass="VRTRawRasterBand">
     <ColorInterp>Red</ColorInterp>
     <SourceFilename relativetoVRT="1">input.dat.ch1</SourceFilename>
     <ImageOffset>0</ImageOffset>
     <PixelOffset>0</PixelOffset>
     <LineOffset>0</LineOffset>
     <ByteOrder>LSB</ByteOrder>
   </VRTRasterBand>
</VRTDataset>

and the lat/lon VRT is

<VRTDataset rasterXSize="2048" rasterYSize="1021">
   <SRS>GEOGCS[&quot;WGS 72&quot;,DATUM[&quot;WGS_1972&quot;,SPHEROID[&quot;WGS 72&quot;,6378135,298.26,AUTHORITY[&quot;EPSG&quot;,&quot;7043&quot;]],AUTHORITY[&quot;EPSG&quot;,&quot;6322&quot;]],PRIMEM[&quot;Greenwich&quot;,0,AUTHORITY[&quot;EPSG&quot;,&quot;8901&quot;]],UNIT[&quot;degree&quot;,0.01745329251994328,AUTHORITY[&quot;EPSG&quot;,&quot;9122&quot;]],AUTHORITY[&quot;EPSG&quot;,&quot;4322&quot;]]</SRS>
   <VRTRasterBand dataType="Float32" band="1" subClass="VRTRawRasterBand">
     <SourceFilename relativetoVRT="1">input.lat</SourceFilename>
     <ByteOrder>LSB</ByteOrder>
   </VRTRasterBand>
</VRTDataset>

An strace shows the input files (input.dat.ch1, input.lat, input.lon) are being opened successfully.


More information about the gdal-dev mailing list