artemp/mapnik — Issue #598: segfault in gdal plugin reading large geotiff (for foss4g benchmarking)
Author: artemp
Created: 2011-10-11 16:28:12+00:00
State: open
Labels: GDAL_Input_Driver

The GDAL plugin is segfaulting on line 289 of gdal_featureset.cpp.

It happens on the second render request of the dataset
* first request is a black tile (which is wrong - should be rgb of aerial image)
* second request a segfault right here: http://trac.mapnik.org/browser/trunk/plugins/input/gdal/gdal_featureset.cpp#L289

This is the one of the raster file's details (there are dozens which are all similar):
{{{
[dane@linux_wms_bm mapnik-trunk]$ gdalinfo /benchmarking/data/raster/PNOA_MA_OF_ETRS89_HU31_h50_0362_bl.tif
Driver: GTiff/GeoTIFF
Files: /benchmarking/data/raster/PNOA_MA_OF_ETRS89_HU31_h50_0362_bl.tif
Size is 25000, 18100
Coordinate System is:
PROJCS["ETRS89 / UTM zone 31N",
GEOGCS["ETRS89",
DATUM["European_Terrestrial_Reference_System_1989",
SPHEROID["GRS 1980",6378137,298.2572221010002,
AUTHORITY["EPSG","7019"]],
AUTHORITY["EPSG","6258"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4258"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",3],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","25831"]]
Origin = (373340.000000000000000,4622440.000000000000000)
Pixel Size = (0.500000000000000,-0.500000000000000)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( 373340.000, 4622440.000) ( 1d28'36.24"E, 41d44'37.28"N)
Lower Left ( 373340.000, 4613390.000) ( 1d28'43.16"E, 41d39'43.93"N)
Upper Right ( 385840.000, 4622440.000) ( 1d37'37.27"E, 41d44'44.10"N)
Lower Right ( 385840.000, 4613390.000) ( 1d37'43.51"E, 41d39'50.73"N)
Center ( 379590.000, 4617915.000) ( 1d33'10.04"E, 41d42'14.10"N)
Band 1 Block=256x256 Type=Byte, ColorInterp=Red
Overviews: 12500x9050, 6250x4525, 3125x2263, 1563x1132, 782x566, 391x283, 196x142, 98x71
Band 2 Block=256x256 Type=Byte, ColorInterp=Green
Overviews: 12500x9050, 6250x4525, 3125x2263, 1563x1132, 782x566, 391x283, 196x142, 98x71
Band 3 Block=256x256 Type=Byte, ColorInterp=Blue
Overviews: 12500x9050, 6250x4525, 3125x2263, 1563x1132, 782x566, 391x283, 196x142, 98x71
}}}

And here is the debug output before crashing:

{{{
GDAL Plugin: Initializing...
GDAL Plugin: Raster Size=25000,17880
GDAL Plugin: Raster Extent=box2d(400580,4576060,413080,4585000)

GDAL Plugin: Initializing...
GDAL Plugin: Raster Size=31500,20000
GDAL Plugin: Raster Extent=box2d(412830,4566500,428580,4576500)

GDAL Plugin: Initializing...
GDAL Plugin: Raster Size=25000,20000
GDAL Plugin: Raster Extent=box2d(373010,4603940,385510,4613940)

GDAL Plugin: Initializing...
GDAL Plugin: Raster Size=31360,17880
GDAL Plugin: Raster Extent=box2d(413080,4576060,428760,4585000)
GDAL Plugin: featureset, dataset = 0x12549490
GDAL Plugin: Raster extent=box2d(441150,4594340,456700,4603180)
GDAL Plugin: View extent=box2d(449647,4594967.5,450086.5,4595262)
GDAL Plugin: Query resolution=1.16893,1.16893
GDAL Plugin: StartX=16994 StartY=15836 Width=879 Height=589
GDAL Plugin: Image Size=(514,344)
GDAL Plugin: Reading band -1
GDAL Plugin: 8 overviews found!
GDAL Plugin: Overview=0 Width=15550 Height=8840
GDAL Plugin: Overview=1 Width=7775 Height=4420
GDAL Plugin: Overview=2 Width=3888 Height=2210
GDAL Plugin: Overview=3 Width=1944 Height=1105
GDAL Plugin: Overview=4 Width=972 Height=553
GDAL Plugin: Overview=5 Width=486 Height=277
GDAL Plugin: Overview=6 Width=243 Height=139
GDAL Plugin: Overview=7 Width=122 Height=70
GDAL Plugin: Block=256x256 Scale=1.000000 Type=Byte Color=Red
GDAL Plugin: Found red band
GDAL Plugin: 8 overviews found!
GDAL Plugin: Overview=0 Width=15550 Height=8840
GDAL Plugin: Overview=1 Width=7775 Height=4420
GDAL Plugin: Overview=2 Width=3888 Height=2210
GDAL Plugin: Overview=3 Width=1944 Height=1105
GDAL Plugin: Overview=4 Width=972 Height=553
GDAL Plugin: Overview=5 Width=486 Height=277
GDAL Plugin: Overview=6 Width=243 Height=139
GDAL Plugin: Overview=7 Width=122 Height=70
GDAL Plugin: Block=256x256 Scale=1.000000 Type=Byte Color=Green
GDAL Plugin: Found green band
GDAL Plugin: 8 overviews found!
GDAL Plugin: Overview=0 Width=15550 Height=8840
GDAL Plugin: Overview=1 Width=7775 Height=4420
GDAL Plugin: Overview=2 Width=3888 Height=2210
GDAL Plugin: Overview=3 Width=1944 Height=1105
GDAL Plugin: Overview=4 Width=972 Height=553
GDAL Plugin: Overview=5 Width=486 Height=277
GDAL Plugin: Overview=6 Width=243 Height=139
GDAL Plugin: Overview=7 Width=122 Height=70
GDAL Plugin: Block=256x256 Scale=1.000000 Type=Byte Color=Blue
GDAL Plugin: Found blue band
GDAL Plugin: processing rgb bands...
GDAL Plugin: closing dataset = 0x12549490
GDAL Plugin: featureset, dataset = 0x12549490
GDAL Plugin: Raster extent=box2d(441150,4594340,456700,4603180)
GDAL Plugin: View extent=box2d(449647,4594967.5,450086.5,4595262)
GDAL Plugin: Query resolution=1.16893,1.16893
GDAL Plugin: StartX=16994 StartY=15836 Width=879 Height=589
GDAL Plugin: Image Size=(514,344)
GDAL Plugin: Reading band -1
GDAL Plugin: 8 overviews found!
GDAL Plugin: Overview=0 Width=15550 Height=8840
GDAL Plugin: Overview=1 Width=7775 Height=4420
GDAL Plugin: Overview=2 Width=3888 Height=2210
GDAL Plugin: Overview=3 Width=1944 Height=1105
GDAL Plugin: Overview=4 Width=972 Height=553
GDAL Plugin: Overview=5 Width=486 Height=277
GDAL Plugin: Overview=6 Width=243 Height=139
GDAL Plugin: Overview=7 Width=122 Height=70
GDAL Plugin: Block=256x256 Scale=1.000000 Type=Byte Color=Red
GDAL Plugin: Found red band
GDAL Plugin: 8 overviews found!
GDAL Plugin: Overview=0 Width=15550 Height=8840
GDAL Plugin: Overview=1 Width=7775 Height=4420
GDAL Plugin: Overview=2 Width=3888 Height=2210
GDAL Plugin: Overview=3 Width=1944 Height=1105
GDAL Plugin: Overview=4 Width=972 Height=553
GDAL Plugin: Overview=5 Width=486 Height=277
GDAL Plugin: Overview=6 Width=243 Height=139
GDAL Plugin: Overview=7 Width=122 Height=70
GDAL Plugin: Block=256x256 Scale=1.000000 Type=Byte Color=Green
GDAL Plugin: Found green band
GDAL Plugin: 8 overviews found!
GDAL Plugin: Overview=0 Width=15550 Height=8840
GDAL Plugin: Overview=1 Width=7775 Height=4420
GDAL Plugin: Overview=2 Width=3888 Height=2210
GDAL Plugin: Overview=3 Width=1944 Height=1105
GDAL Plugin: Overview=4 Width=972 Height=553
GDAL Plugin: Overview=5 Width=486 Height=277
GDAL Plugin: Overview=6 Width=243 Height=139
GDAL Plugin: Overview=7 Width=122 Height=70
GDAL Plugin: Block=256x256 Scale=1.000000 Type=Byte Color=Blue
GDAL Plugin: Found blue band
GDAL Plugin: processing rgb bands...
Segmentation fault
}}}