[postgis-users] segmentation fault

Gold, Jack L (US SSA) jack.gold at baesystems.com
Wed May 16 05:48:07 PDT 2012


It seems that going through each of the individual libraries (proj.4, geos, gdal, and postgis-2.0) and running make clean, make install yielded new libraries that worked without the segfault.  I'm thinking that old 32-bit object files were lying around in the previous build environment and something managed to link incorrectly.

--Jack Gold

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Gold, Jack L (US SSA)
Sent: Tuesday, May 15, 2012 8:43 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] segmentation fault

I decided to run a core dump and see if I can spot why the call to the library is causing the crash.  I still don't know what is causing the crash, but I suspect it's one of the features I compiled into the postgis library.  Below is the dump and a file listing that indicates that all the libraries are indeed x86_64:

[root at localhost data]# gdb /usr/pgsql-9.1/bin/postgres core.3252 GNU gdb (GDB) CentOS (7.0.1-42.el5.centos) Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/pgsql-9.1/bin/postgres...(no debugging symbols found)...done.

warning: core file may not match specified executable file.
[New Thread 3252]
Reading symbols from /usr/lib64/libxslt.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libxslt.so.1 Reading symbols from /usr/lib64/libxml2.so.2...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libxml2.so.2 Reading symbols from /lib64/libpam.so.0...(no debugging symbols found)...done.
Loaded symbols for /lib64/libpam.so.0
Reading symbols from /lib64/libssl.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libssl.so.6
Reading symbols from /lib64/libcrypto.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libcrypto.so.6 Reading symbols from /usr/lib64/libgssapi_krb5.so.2...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libgssapi_krb5.so.2 Reading symbols from /lib64/libcrypt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libcrypt.so.1
Reading symbols from /lib64/libdl.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/libm.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /usr/lib64/libldap-2.3.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libldap-2.3.so.0 Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /usr/lib64/libkrb5.so.3...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libkrb5.so.3 Reading symbols from /lib64/libcom_err.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libcom_err.so.2 Reading symbols from /lib64/libz.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libz.so.1
Reading symbols from /lib64/libaudit.so.0...(no debugging symbols found)...done.
Loaded symbols for /lib64/libaudit.so.0
Reading symbols from /usr/lib64/libk5crypto.so.3...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libk5crypto.so.3 Reading symbols from /usr/lib64/libkrb5support.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libkrb5support.so.0 Reading symbols from /lib64/libkeyutils.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libkeyutils.so.1 Reading symbols from /lib64/libresolv.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libresolv.so.2 Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2 Reading symbols from /usr/lib64/liblber-2.3.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/liblber-2.3.so.0 Reading symbols from /usr/lib64/libsasl2.so.2...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libsasl2.so.2 Reading symbols from /lib64/libselinux.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libselinux.so.1 Reading symbols from /lib64/libsepol.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libsepol.so.1
Reading symbols from /lib64/libnss_files.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libnss_files.so.2 Reading symbols from /usr/pgsql-9.1/lib/postgis-2.0.so...done.
Loaded symbols for /usr/pgsql-9.1/lib/postgis-2.0.so Reading symbols from /usr/local/lib/libgeos_c.so.1...done.
Loaded symbols for /usr/local/lib/libgeos_c.so.1 Reading symbols from /usr/local/lib/libproj.so.0...done.
Loaded symbols for /usr/local/lib/libproj.so.0 Reading symbols from /usr/local/lib/libgeos-3.3.2.so...done.
Loaded symbols for /usr/local/lib/libgeos-3.3.2.so Reading symbols from /usr/lib64/libstdc++.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libstdc++.so.6 Reading symbols from /lib64/libgcc_s.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libgcc_s.so.1

warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7fff99ffd000
Core was generated by `postgres: postgres cid 127.0.0.1(45297) CREATE FUNCTION    '.
Program terminated with signal 11, Segmentation fault.
#0  0x0000000000097520 in ?? ()
(gdb) where
#0  0x0000000000097520 in ?? ()
#1  0x00002b2abb23e2a6 in __do_global_ctors_aux () from /usr/local/lib/libgeos-3.3.2.so
#2  0x00002b2abb177493 in _init () from /usr/local/lib/libgeos-3.3.2.so
#3  0x00002b2aba8f5810 in ?? () from /usr/pgsql-9.1/lib/postgis-2.0.so
#4  0x00000036b420d45b in call_init () from /lib64/ld-linux-x86-64.so.2
#5  0x00000036b420d565 in _dl_init_internal () from /lib64/ld-linux-x86-64.so.2
#6  0x00000036b4211004 in dl_open_worker () from /lib64/ld-linux-x86-64.so.2
#7  0x00000036b420d0e6 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#8  0x00000036b421086c in _dl_open () from /lib64/ld-linux-x86-64.so.2
#9  0x00000036b5200f9a in dlopen_doit () from /lib64/libdl.so.2
#10 0x00000036b420d0e6 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#11 0x00000036b520150d in _dlerror_run () from /lib64/libdl.so.2
#12 0x00000036b5200f11 in dlopen@@GLIBC_2.2.5 () from /lib64/libdl.so.2
#13 0x00000000006dc337 in ?? ()
#14 0x00000000006dc916 in load_external_function ()
#15 0x00000000004c8226 in fmgr_c_validator ()
#16 0x00000000006dff54 in OidFunctionCall1Coll ()
#17 0x00000000004c9896 in ProcedureCreate ()
#18 0x00000000005234a6 in CreateFunction ()
#19 0x0000000000623a59 in ?? ()
#20 0x0000000000624ac9 in ?? ()
#21 0x00000000006254f5 in PortalRun ()
#22 0x0000000000622005 in ?? ()
#23 0x0000000000622854 in PostgresMain ()
#24 0x00000000005e7344 in ?? ()
#25 0x00000000005e80bc in PostmasterMain ()
#26 0x000000000058c1de in main ()
(gdb) q


[root at localhost data]# file /usr/local/lib/*
/usr/local/lib/libgdalconstjni.so:        symbolic link to `libgdalconstjni.so.1.16.0'
/usr/local/lib/libgdalconstjni.so.1:      symbolic link to `libgdalconstjni.so.1.16.0'
/usr/local/lib/libgdalconstjni.so.1.16.0: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped
/usr/local/lib/libgdaljni.so:             symbolic link to `libgdaljni.so.1.16.0'
/usr/local/lib/libgdaljni.so.1:           symbolic link to `libgdaljni.so.1.16.0'
/usr/local/lib/libgdaljni.so.1.16.0:      ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped
/usr/local/lib/libgdal.so:                symbolic link to `libgdal.so.1.16.0'
/usr/local/lib/libgdal.so.1:              symbolic link to `libgdal.so.1.16.0'
/usr/local/lib/libgdal.so.1.16.0:         ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped
/usr/local/lib/libgeos-3.3.2.so:          ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped
/usr/local/lib/libgeos_c.so:              symbolic link to `libgeos_c.so.1.7.2'
/usr/local/lib/libgeos_c.so.1:            symbolic link to `libgeos_c.so.1.7.2'
/usr/local/lib/libgeos_c.so.1.7.2:        ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped
/usr/local/lib/libgeos.so:                symbolic link to `libgeos-3.3.2.so'
/usr/local/lib/liblwgeom-2.0.1SVN.so:     ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped
/usr/local/lib/liblwgeom.so:              symbolic link to `liblwgeom-2.0.1SVN.so'
/usr/local/lib/libogrjni.so:              symbolic link to `libogrjni.so.1.16.0'
/usr/local/lib/libogrjni.so.1:            symbolic link to `libogrjni.so.1.16.0'
/usr/local/lib/libogrjni.so.1.16.0:       ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped
/usr/local/lib/libosrjni.so:              symbolic link to `libosrjni.so.1.16.0'
/usr/local/lib/libosrjni.so.1:            symbolic link to `libosrjni.so.1.16.0'
/usr/local/lib/libosrjni.so.1.16.0:       ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped
/usr/local/lib/libproj.so:                ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped
/usr/local/lib/libproj.so.0:              symbolic link to `libproj.so.0.7.0'
/usr/local/lib/libproj.so.0.7.0:          ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped
/usr/local/lib/licenses:                  directory
[root at localhost data]#


-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Gold, Jack L (US SSA)
Sent: Monday, May 14, 2012 2:40 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] segmentation fault

Nah.  I rebuilt the database from scratch on 2.0, so that seems unlikely.  It segfaults when I create a fresh db and try to load postgis.sql.  no data in the db yet.

--jlg

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Paul Ramsey
Sent: Friday, May 11, 2012 2:22 AM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] segmentation fault

My bet: You've compiled and installed postgis2.0 on top of a
postgis1.5 database. That is, you haven't re-loaded your data, you're trying to use your old data with the new code. That would probably cause segfaults on simple things like object access.

P.

On Thu, May 10, 2012 at 10:06 PM, Gold, Jack L  (US SSA) <jack.gold at baesystems.com> wrote:
> It appears it is the postgis-2.0.so library that is causing the
> problem.  I removed all but one call the library and it still
> occurred.  I tried some basic queries with no problem.  I'll have to go back to my compilation.
>
>
>
> --Jack Gold
>
>
>
> From: postgis-users-bounces at postgis.refractions.net
> [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
> Gold, Jack L (US SSA)
> Sent: Thursday, May 10, 2012 4:53 PM
> To: PostGIS Users Discussion (postgis-users at postgis.refractions.net)
> Subject: [postgis-users] segmentation fault
>
>
>
> I'm trying to rebuild my i386(RHEL5) database (PostGIS-2.0.1SVN) on
> x86_64 (CentOS).  I've managed to build all of the libraries and I
> believe they are all installed correctly, but when I attempt to load
> postgis.sql, I get a seg-fault and the postmaster restarts wth:
>
>
>
> .LANGUAGE 'plpgsql' IMMUTABLE STRICT;
>
> ERROR:  current transaction is aborted, commands ignored until end of
> transaction block
>
> STATEMENT:  CREATE OR REPLACE FUNCTION _ST_AsX3D(int4, geometry, int4,
> int4,
> text)
>
>                 RETURNS TEXT
>
>                 AS '$libdir/postgis-2.0','LWGEOM_asX3D'
>
>                 LANGUAGE 'C' IMMUTABLE;
>
> ERROR:  current transaction is aborted, commands ignored until end of
> transaction block
>
> STATEMENT:  CREATE OR REPLACE FUNCTION ST_AsX3D(geom geometry,
> maxdecimaldigits integer DEFAULT 15, options integer DEFAULT 0)
>
>                 RETURNS TEXT
>
>                 AS $$SELECT _ST_AsX3D(3,$1,$2,$3,'');$$
>
>                 LANGUAGE 'sql' IMMUTABLE;
>
> LOG:  received fast shutdown request
>
> LOG:  aborting any active transactions
>
> LOG:  autovacuum launcher shutting down
>
> LOG:  shutting down
>
> LOG:  database system is shut down
>
> LOG:  database system was shut down at 2012-05-10 20:42:21 UTC
>
> LOG:  autovacuum launcher started
>
> LOG:  database system is ready to accept connections
>
> LOG:  server process (PID 8543) was terminated by signal 11:
> Segmentation fault
>
> LOG:  terminating any other active server processes
>
> WARNING:  terminating connection because of crash of another server
> process
>
> DETAIL:  The postmaster has commanded this server process to roll back
> the current transaction and exit, because another server process
> exited abnormally and possibly corrupted shared memory.
>
> HINT:  In a moment you should be able to reconnect to the database and
> repeat your command.
>
> LOG:  all server processes terminated; reinitializing
>
> LOG:  database system was interrupted; last known up at 2012-05-10
> 20:42:22 UTC
>
> LOG:  database system was not properly shut down; automatic recovery
> in progress
>
> LOG:  record with zero length at 0/2A9A0F0
>
> LOG:  redo is not required
>
> LOG:  autovacuum launcher started
>
> LOG:  database system is ready to accept connections
>
> LOG:  server process (PID 8572) was terminated by signal 11:
> Segmentation fault
>
> LOG:  terminating any other active server processes
>
> WARNING:  terminating connection because of crash of another server
> process
>
> DETAIL:  The postmaster has commanded this server process to roll back
> the current transaction and exit, because another server process
> exited abnormally and possibly corrupted shared memory.
>
> HINT:  In a moment you should be able to reconnect to the database and
> repeat your command.
>
> LOG:  all server processes terminated; reinitializing
>
> LOG:  database system was interrupted; last known up at 2012-05-10
> 20:42:28 UTC
>
> LOG:  database system was not properly shut down; automatic recovery
> in progress
>
> LOG:  record with zero length at 0/2A9A148
>
> LOG:  redo is not required
>
> LOG:  autovacuum launcher started
>
> LOG:  database system is ready to accept connections
>
> LOG:  server process (PID 8581) was terminated by signal 11:
> Segmentation fault
>
> LOG:  terminating any other active server processes
>
> WARNING:  terminating connection because of crash of another server
> process
>
> DETAIL:  The postmaster has commanded this server process to roll back
> the current transaction and exit, because another server process
> exited abnormally and possibly corrupted shared memory.
>
> HINT:  In a moment you should be able to reconnect to the database and
> repeat your command.
>
> LOG:  all server processes terminated; reinitializing
>
> LOG:  database system was interrupted; last known up at 2012-05-10
> 20:42:33 UTC
>
> LOG:  database system was not properly shut down; automatic recovery
> in progress
>
> LOG:  record with zero length at 0/2A9A1A0
>
> LOG:  redo is not required
>
> LOG:  autovacuum launcher started
>
> LOG:  database system is ready to accept connections
>
>
>
> I'm looking around for more detail, but I'm not seeing anything. Any
> ideas where I should look next?
>
>
>
> --Jack Gold
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list