[postgis-devel] segfault during regress

Greg Troxel gdt at ir.bbn.com
Wed Jan 25 15:46:01 PST 2012


I just updated and ran gmake check.  This time the loader/Latin1 test
failed again, but it printed

  Unable to open loader/Latin1.shp or loader/Latin1.SHP.
  Unable to open loader/Latin1.shx or loader/Latin1.SHX.

and then shp2pgsql segfaulted.  The problem was that it tried to close
the file handle for the .shp when it couldn't open the .shx, but should
have checked for NULL or aborted.  The following patch, surely not
right, points out where the issue is.  (Rerunning with it got me back to
the state where the string doesn't fit, which is a test harness issue
that I still have not managed to addreses.)

Index: loader/shpopen.c
===================================================================
--- loader/shpopen.c	(revision 8924)
+++ loader/shpopen.c	(working copy)
@@ -552,6 +552,9 @@
                   pszBasename, pszBasename );
         psHooks->Error( pszMessage );
         free( pszMessage );
+
+	/* XXX free stuff */
+	return( NULL );
     }
 
     sprintf( pszFullname, "%s.shx", pszBasename );


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20120125/5edc0195/attachment.sig>


More information about the postgis-devel mailing list