[gdal-dev] Crash: [GDAL 1.10dev] empty shapefile with spatial index

Even Rouault even.rouault at mines-paris.org
Fri Apr 5 03:07:13 PDT 2013


Selon Dennis Gocke <dengo at gmx.net>:

> Hi,
>
> I've encountered a serious problem with an empty shapefile (no features)
> that already has sbn, sbx files generated. When trying to create a feature
> there is an Access Violation and the program crashes without any chance to
> catch the exception.
> The shapefile was exported with ArcCatalog, but the same happens when
> creating an empty shapefile with OGR and then creating spatial index on it
> with ArcCatalog.
>
> Trying "DROP SPATIAL INDEX ON.." in OGR also produces the same crash.
>
> When manually deleting the sbn, sbx files before opening the shapefile with
> OGR, everything works fine.
>
> I am using the C# wrapper, but I am sure the problem is in OGR itself.
> The lines that can be used to reproduce the crash:
>
> DataSource ds = Ogr.Open(@"D:\test\IndustryA_O.shp", 1);
> Layer layer = ds.GetLayerByIndex(0);
> FeatureDefn featureDefn = layer.GetLayerDefn();
> Feature newFeature = new Feature(featureDefn);
> layer.CreateFeature(newFeature);  // <-- Crash
>
> Using GDAL 1.9.2 does not produce the crash, but this was to be expected
> because 1.9.2 just ignores the spatial index.
>
> I've also attached the shapefile. Hopefully this works with the mailing
> list.

Thanks for the precise report. I've managed to reproduce and committed a fix in
r25862.

>
> Regards,
> Dennis
>




More information about the gdal-dev mailing list