Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#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)

TOPCON WATER_METER.zip (3.1 KB ) - added by stevenxu 15 years ago.

Download all attachments as: .zip

Change History (4)

by stevenxu, 15 years ago

Attachment: TOPCON WATER_METER.zip added

comment:1 by stevenxu, 15 years ago

Owner: changed from StevenXu to stevenxu
Status: newassigned
Version: 3.4.03.3.2

The attachment contains the corrupted idx file.

comment:2 by stevenxu, 15 years ago

Resolution: fixed
Status: assignedclosed

Made two change:

  1. Catch the exception in the destructor of ShpFileSet
  2. 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 stevenxu, 15 years ago

Fixed in trunk with submission https://trac.osgeo.org/fdo/changeset/4249

Note: See TracTickets for help on using tickets.