[postgis-users] shp2psql problems

Paul Ramsey pramsey at refractions.net
Tue Feb 4 15:07:48 PST 2003

There was a memory management problem in the DBF header checking code 
(used to remove postgres-illegal things from the column names) which was 
messing up the DBF handle in rare cases. It has been fixed and committed 
to CVS.

Paul Ramsey wrote:
> There is some nasty code which is corrupting the DBF file handle after 
> it is opened. Dave thinks probably an array is getting written out of 
> bounds. Anyhow, it turns out there is a workaround, and that is to 
> rename the file to a shorter name (??!?!). I found three-letter names 
> working OK. Jeff has to spend some time communing with a debugger in 
> order to track this one down.
> P.
> Jeff Lounsbury wrote:
>> This was an odd one, it appears that by changing the dbf structure(ie,
>> deleting a column or two) , the file then loads into postgis fine. Even
>> by removing the shape and adding a simple square the same seg fault
>> occurs so it is pretty much certain that there is some problem with the
>> DBF file itself. Although looking through the dbf file we can't see any
>> way that it is particulary different from other in any way?? So it seems
>> this is a problem to look at through the shapelib package and the dbf
>> reader in that that shp2pgsql uses. Maybe Frank can take a look at that
>> DBF and give us some insight into it.
>> And if Michel wants to let us know where the shp/dbf files were created
>> from, that might help figure it out as well...
>> -Jeff
>> Laurent Michel wrote:
>>> Dear all,
>>> I attached to this mail a shapefile (some French adminstrative areas)
>>> which shp2psql cannot handle (segmentation error).
>>> Thanks in advance for your kind help,

      | Paul Ramsey
      | Refractions Research
      | Email: pramsey at refractions.net
      | Phone: (250) 885-0632

More information about the postgis-users mailing list