[postgis-users] shp2pgsql crashes

Alex Rice alex_rice at arc.to
Mon Jul 15 09:30:44 PDT 2002


On Monday, July 15, 2002, at 09:28  AM, Steffen Macke wrote:

>> Hi, these are the shapefiles from
>> http://www.nationalatlas.gov/atlasftp.html
>> which crashed shp2pgsql:
>>
>> Public Land Survey (plss00p020)
>
> I tested this one and it worked. However the file
> contains NULL values, so you'll need the CVS version
> of shp2pgsql to run it successfully. Can you make sure that you're
> actually using the shp2pgsql version from CVS? Maybe there's an
> older one lurking somewhere in your path.
>
> Steffen

I verified and it still crashes on me.

I just rebuilt and installed postgis from 
http://postgis.refractions.net/postgis-cvs.tar.gz. shp2pgsql was 
installed into /usr/local/pgsql/bin/.  plss00p020 still crashes it.

Then did an actual CVS checkout of postgis into postgresql-src/contrib. 
Edited Makefile and set USE_PG72=1. Ran make. Ran sudo make install. 
plss00p020 crashes still. There is no other shp2pgsql on my system.

The command I'm using to convert these files is:
/usr/local/pgsql/bin/shp2pgsql -D plss00p020 public_land_survey 
postgis > public_land.dump

Maybe this is a platform-dependent bug? I'm running Mac OS X 10.1.5. 
Below is the make output.
There is a warning about DBF open: dbfopen.c:155: warning: `rcsid' 
defined but not used

[localhost:postgresql-7.2.1/contrib/postgis] alex% make
cc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes 
-Wmissing-declarations  -g  -I. -I../../src/include  -DFRONTEND 
-DSYSCONFDIR='"/usr/local/pgsql/etc"'   -c -o postgis_debug.o 
postgis_debug.c
cc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes 
-Wmissing-declarations  -g  -I. -I../../src/include  -DFRONTEND 
-DSYSCONFDIR='"/usr/local/pgsql/etc"'   -c -o postgis_ops.o postgis_ops.c
cc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes 
-Wmissing-declarations  -g  -I. -I../../src/include  -DFRONTEND 
-DSYSCONFDIR='"/usr/local/pgsql/etc"'   -c -o postgis_fn.o postgis_fn.c
cc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes 
-Wmissing-declarations  -g  -I. -I../../src/include  -DFRONTEND 
-DSYSCONFDIR='"/usr/local/pgsql/etc"'   -c -o postgis_inout.o 
postgis_inout.c
cc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes 
-Wmissing-declarations  -g  -I. -I../../src/include  -DFRONTEND 
-DSYSCONFDIR='"/usr/local/pgsql/etc"'   -c -o postgis_proj.o 
postgis_proj.c
cc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes 
-Wmissing-declarations  -g  -I. -I../../src/include  -DFRONTEND 
-DSYSCONFDIR='"/usr/local/pgsql/etc"'   -c -o postgis_chip.o 
postgis_chip.c
cc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes 
-Wmissing-declarations  -g  -I. -I../../src/include  -DFRONTEND 
-DSYSCONFDIR='"/usr/local/pgsql/etc"'   -c -o postgis_transform.o 
postgis_transform.c
cc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes 
-Wmissing-declarations  -g  -I. -I../../src/include  -DFRONTEND 
-DSYSCONFDIR='"/usr/local/pgsql/etc"'   -c -o postgis_gist_72.o 
postgis_gist_72.c
ar cr libpostgis.a `lorder postgis_debug.o postgis_ops.o postgis_fn.o 
postgis_inout.o postgis_proj.o postgis_chip.o postgis_transform.o 
postgis_gist_72.o | tsort`
ranlib libpostgis.a
cc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes 
-Wmissing-declarations  -flat_namespace -bundle -undefined suppress 
postgis_debug.o postgis_ops.o postgis_fn.o postgis_inout.o 
postgis_proj.o postgis_chip.o postgis_transform.o postgis_gist_72.o     
-o libpostgis.so.0.7
rm -f libpostgis.so.0
ln -s libpostgis.so.0.7 libpostgis.so.0
rm -f libpostgis.so
ln -s libpostgis.so.0.7 libpostgis.so
sed -e 
's:@MODULE_FILENAME@:/usr/local/pgsql/lib/contrib/libpostgis.so.0.7:g;s:@P
OSTGIS_VERSION@:0.7:g' < postgis.sql.in > postgis.sql
if [ 1 -eq 1 ]; then \
         sed -e 
's:@MODULE_FILENAME@:/usr/local/pgsql/lib/contrib/libpostgis.so.0.7:g;s:@P
OSTGIS_VERSION@:0.7:g' < postgis_gist_72.sql.in >> postgis.sql; \
else \
         sed -e 
's:@MODULE_FILENAME@:/usr/local/pgsql/lib/contrib/libpostgis.so.0.7:g;s:@P
OSTGIS_VERSION@:0.7:g' < postgis_gist.sql.in >> postgis.sql; \
fi
perl create_undef.pl postgis.sql > postgis_undef.sql
make -C loader
cc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes 
-Wmissing-declarations -g -I. -I../../../src/interfaces/libpq 
-I../../../src/include  -DFRONTEND 
-DSYSCONFDIR='"/usr/local/pgsql/etc"'  -c -o shpopen.o shpopen.c
shpopen.c:146: warning: `rcsid' defined but not used
cc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes 
-Wmissing-declarations -g -I. -I../../../src/interfaces/libpq 
-I../../../src/include  -DFRONTEND 
-DSYSCONFDIR='"/usr/local/pgsql/etc"'  -c -o dbfopen.o dbfopen.c
dbfopen.c:155: warning: `rcsid' defined but not used
cc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes 
-Wmissing-declarations -g -I. -I../../../src/interfaces/libpq 
-I../../../src/include  -DFRONTEND 
-DSYSCONFDIR='"/usr/local/pgsql/etc"'  -c -o getopt.o getopt.c
getopt.c:603: warning: no previous prototype for `getopt'
cc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes 
-Wmissing-declarations -g -I. -I../../../src/interfaces/libpq 
-I../../../src/include  -DFRONTEND 
-DSYSCONFDIR='"/usr/local/pgsql/etc"'  -c -o shp2pgsql.o shp2pgsql.c
shp2pgsql.c: In function `main':
shp2pgsql.c:455: warning: implicit declaration of function `getopt'
cc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes 
-Wmissing-declarations shpopen.o dbfopen.o getopt.o shp2pgsql.o 
-L../../../src/interfaces/libpq -lpq   -lz -lm  -o shp2pgsql
/usr/bin/ld: warning unused multiple definitions of symbol _getopt
getopt.o definition of _getopt in section (__TEXT,__text)
/usr/lib/libm.dylib(getopt.o) unused definition of _getopt
/usr/bin/ld: warning unused multiple definitions of symbol _optarg
getopt.o definition of _optarg in section (__DATA,__data)
/usr/lib/libm.dylib(getopt.o) unused definition of _optarg
/usr/bin/ld: warning unused multiple definitions of symbol _opterr
getopt.o definition of _opterr in section (__DATA,__data)
/usr/lib/libm.dylib(getopt.o) unused definition of _opterr
/usr/bin/ld: warning unused multiple definitions of symbol _optind
getopt.o definition of _optind in section (__DATA,__data)
/usr/lib/libm.dylib(getopt.o) unused definition of _optind
/usr/bin/ld: warning unused multiple definitions of symbol _optopt
getopt.o definition of _optopt in section (__DATA,__data)
/usr/lib/libm.dylib(getopt.o) unused definition of _optopt
cc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes 
-Wmissing-declarations -g -I. -I../../../src/interfaces/libpq 
-I../../../src/include  -DFRONTEND 
-DSYSCONFDIR='"/usr/local/pgsql/etc"'  -c -o pgsql2shp.o pgsql2shp.c
pgsql2shp.c: In function `main':
pgsql2shp.c:75: warning: implicit declaration of function `getopt'
cc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes 
-Wmissing-declarations shpopen.o dbfopen.o getopt.o pgsql2shp.o 
-L../../../src/interfaces/libpq -lpq   -lz -lm  -o pgsql2shp
/usr/bin/ld: warning unused multiple definitions of symbol _getopt
getopt.o definition of _getopt in section (__TEXT,__text)
/usr/lib/libm.dylib(getopt.o) unused definition of _getopt
/usr/bin/ld: warning unused multiple definitions of symbol _optarg
getopt.o definition of _optarg in section (__DATA,__data)
/usr/lib/libm.dylib(getopt.o) unused definition of _optarg
/usr/bin/ld: warning unused multiple definitions of symbol _opterr
getopt.o definition of _opterr in section (__DATA,__data)
/usr/lib/libm.dylib(getopt.o) unused definition of _opterr
/usr/bin/ld: warning unused multiple definitions of symbol _optind
getopt.o definition of _optind in section (__DATA,__data)
/usr/lib/libm.dylib(getopt.o) unused definition of _optind
/usr/bin/ld: warning unused multiple definitions of symbol _optopt
getopt.o definition of _optopt in section (__DATA,__data)
/usr/lib/libm.dylib(getopt.o) unused definition of _optopt

[localhost:postgresql-7.2.1/contrib/postgis] alex% sudo make install
Password:
make -C loader
make[1]: Nothing to be done for `all'.
/bin/sh ../../config/install-sh -c -m 644 libpostgis.a 
/usr/local/pgsql/lib/contrib/libpostgis.a
/bin/sh ../../config/install-sh -c -m 755 libpostgis.so.0.7 
/usr/local/pgsql/lib/contrib/libpostgis.so.0.7
cd /usr/local/pgsql/lib/contrib && \
rm -f libpostgis.so.0 && \
ln -s libpostgis.so.0.7 libpostgis.so.0
cd /usr/local/pgsql/lib/contrib && \
rm -f libpostgis.so && \
ln -s libpostgis.so.0.7 libpostgis.so
/bin/sh ../../config/install-sh -c -m 644 ./README.postgis  
/usr/local/pgsql/doc/contrib
/bin/sh ../../config/install-sh -c -m 644 postgis.sql 
/usr/local/pgsql/share/contrib
/bin/sh ../../config/install-sh -c -m 644 postgis_undef.sql 
/usr/local/pgsql/share/contrib
/bin/sh ../../config/install-sh -c -m 644 spatial_ref_sys.sql 
/usr/local/pgsql/share/contrib
/bin/sh ../../config/install-sh -c -m 644 README.postgis 
/usr/local/pgsql/share/contrib
make -C loader install
/bin/sh ../../../config/install-sh -c pgsql2shp 
/usr/local/pgsql/bin/pgsql2shp
/bin/sh ../../../config/install-sh -c shp2pgsql 
/usr/local/pgsql/bin/shp2pgsql


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