[postgis-users] shp2pgsql crashes

Alex Rice alex_rice at arc.to
Tue Jul 16 07:39:14 PDT 2002


On Tuesday, July 16, 2002, at 07:19  AM, Frank Warmerdam wrote:
> Alex,
>
> I am the maintainer of Shapelib (dbfopen.c, shpopen.c, shapefil.h) 
> though not
> of shp2pgsql.  Could you give me any more information on why you think 
> dbfopen
> has a problem with long filenames?  I am looking at the current 
> dbfopen.c
> source and I can see no limitations about long filenames.
>
> If there is a problem in my code, I would be happy to try and fix it.

Hi Frank. I looked at dbfopen.c and could not see any particular problem 
either. I'm trying to deduce what's causing the crashes with shp2pgsql. 
Here is what i know. I'm going to cc: the list in case anyone else can 
see it.

- shp2pgsql was crashing on a certain set of shapefiles, on Mac OS X (I 
mentioned these on the list)
- all of those crashing filenames were > 8.3.
- some other > 8.3 filenames imported fine, however.
- renaming the problematic files to 8.3 or shorter removed the crashing 
condition.
- the stack trace points to DBFReadAttribute() dbfopen.c

Here are a couple of examples:

% tar xvzf railrdl020.tar.gz
railrdl020.dbf
railrdl020.shp
railrdl020.shx
railrdl020.txt
% /usr/local/pgsql/bin/shp2pgsql -d railrdl020 railroads postgis > 
railroads.dump
Segmentation fault

Thread 0 Crashed:
  #0   0x32300000 in 0x32300000
  #1   0x70014f9c in fseeko
  #2   0x000052f8 in DBFReadAttribute
  #3   0x0000756c in Insert_attributes
  #4   0x000080b4 in main
  #5   0x0000193c in _start
  #6   0x0000176c in start

----------
% tar xvzf countyp020.tar.gz
countyp020.dbf
countyp020.shp
countyp020.shx
countyp020.txt
% /usr/local/pgsql/bin/shp2pgsql -d countyp020 counties postgis > 
counties.dump
Segmentation fault

Thread 0 Crashed:
  #0   0x32300000 in 0x32300000
  #1   0x70014f9c in fseeko
  #2   0x000052f8 in DBFReadAttribute
  #3   0x0000756c in Insert_attributes
  #4   0x000080b4 in main
  #5   0x0000193c in _start
  #6   0x0000176c in start


Alex Rice, Software Developer
Architectural Research Consultants, Inc.
alex_rice at arc.to
alrice at swcp.com






More information about the postgis-users mailing list