#429 closed enhancement (fixed)
SHP provider crash in import/export of the corrupted or invalid spatial index file(idx)
Reported by: | stevenxu | Owned by: | stevenxu |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | SHP Provider | Version: | 3.3.2 |
Severity: | 3 | Keywords: | |
Cc: | External ID: |
Description
The corrupted or invalid spatial index file can lead unhandled FdoException in destructor of class "ShpFileSet", as following:
\Providers\SHP\Src\Provider\ShpFileSet.cpp
ShpFileSet::~ShpFileSet (void) {
if ( mFilesExist ){
ReopenFileset( FdoCommonFile::IDF_OPEN_READ );
.....
}
The function "ReopenFileset" will open the idx file and generate a FdoException when the idx file is invalid. This unhandled exception can lead application crash.
You can modify the idx file deliberately to reproduce this problem. For example, use text editor to modify the first characters of this file as any others.
Attachments (1)
Change History (4)
by , 16 years ago
Attachment: | TOPCON WATER_METER.zip added |
---|
comment:1 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Version: | 3.4.0 → 3.3.2 |
comment:2 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Made two change:
- Catch the exception in the destructor of ShpFileSet
- Remove the invalid idx file and rebuild the spatial index file when member function "GetSpatialIndex" fail to open it at the first time.
Fixed in branch with submission https://trac.osgeo.org/fdo/changeset/4243
comment:3 by , 16 years ago
Fixed in trunk with submission https://trac.osgeo.org/fdo/changeset/4249
The attachment contains the corrupted idx file.