Opened 16 years ago

Closed 16 years ago

#2073 closed defect (fixed)

WMS Driver: Failed downloads cause segfault

Reported by: crschmidt Owned by: nowak
Priority: normal Milestone: 1.5.0
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords:
Cc: Even Rouault

Description

A failed download of a tile due to a 500 error can cause a segfault.

Input file size is 1073741824, 536870912
Computed -srcwin 321126400 141315406 262144 208087 from projected window.
0ERROR 1: GDALWMS: Unable to download block 2450, 1078 (http://tile.openaerialmap.org/tiles/?request=GetMap&version=1&layers=openaerialmap&styles=&srs=EPSG:4326&format=image/jpeg&width=256&height=256&bbox=-72.333984,42.583008,-72.290039,42.626953). HTTP status code: 500
ERROR 1: IReadBlock failed at X offset 2450, Y offset 1078
ERROR 2: Out of memory in InitBlockInfo().
./gdal_translate: line 9: 17406 Segmentation fault      $FWTOOLS_HOME/bin/`basename $TARGET` "$@"
#0  0xf7a42ba5 in GDALRasterBand::TryGetLockedBlockRef () from /home/crschmidt/FWTools-2.0.0/lib/libgdal.so
#1  0xf7a42c26 in GDALRasterBand::GetLockedBlockRef () from /home/crschmidt/FWTools-2.0.0/lib/libgdal.so
#2  0xf7a47964 in GDALRasterBand::IRasterIO () from /home/crschmidt/FWTools-2.0.0/lib/libgdal.so
#3  0xf79e72f8 in GDALWMSRasterBand::IRasterIO () from /home/crschmidt/FWTools-2.0.0/lib/libgdal.so
#4  0xf7a421a3 in GDALRasterBand::RasterIO () from /home/crschmidt/FWTools-2.0.0/lib/libgdal.so
#5  0xf7a1b903 in VRTSimpleSource::RasterIO () from /home/crschmidt/FWTools-2.0.0/lib/libgdal.so
#6  0xf7a19c00 in VRTSourcedRasterBand::IRasterIO () from /home/crschmidt/FWTools-2.0.0/lib/libgdal.so
#7  0xf7a33283 in GDALDataset::IRasterIO () from /home/crschmidt/FWTools-2.0.0/lib/libgdal.so
#8  0xf7a3347b in GDALDataset::RasterIO () from /home/crschmidt/FWTools-2.0.0/lib/libgdal.so
#9  0xf7a49ec3 in GDALDatasetCopyWholeRaster () from /home/crschmidt/FWTools-2.0.0/lib/libgdal.so
#10 0xf78dd1bc in GTiffCreateCopy () from /home/crschmidt/FWTools-2.0.0/lib/libgdal.so
#11 0xf7a36526 in GDALDriver::CreateCopy () from /home/crschmidt/FWTools-2.0.0/lib/libgdal.so
#12 0xf7a3662b in GDALCreateCopy () from /home/crschmidt/FWTools-2.0.0/lib/libgdal.so
#13 0x0804a448 in ProxyMain ()
#14 0x0804b9d7 in main ()

Change History (3)

comment:1 by nowakpl, 16 years ago

Not a bug in WMS driver. Problem seems to be in GDALRasterBand::TryGetLockedBlockRef, return value of InitBlockInfo is not checked that in this case fails with out of memory.

comment:2 by Even Rouault, 16 years ago

Cc: Even Rouault added

I've commited tests that check InitBlockInfo return value in r13283. Could you confirm that it solves your crash ?

comment:3 by Even Rouault, 16 years ago

Milestone: 1.5.0
Resolution: fixed
Status: newclosed

Additionnal test commited in r13287 that prevents the crash. Confirmed by crschmidt.

Note: See TracTickets for help on using tickets.