[postgis-users] Postgis on Solaris - gdb details

Ionut Iordache ionut at eps.berkeley.edu
Wed Feb 9 19:07:53 PST 2005


Hello,

I found a more specific reason why my installation crashes:

Following is an excerpt from running gdb against the backend and
breaking at a point close to where it crashes after executing " select
X(geom) from gtest;":

----------------------------------------------------------------------
Breakpoint 2, LWGEOM_x_point (fcinfo=0xffbed600) at lwgeom_ogc.c:528
528             if ( point == NULL ) PG_RETURN_NULL();
(gdb) print point
$1 = (LWPOINT *) 0x37f188
(gdb) print point->point
$2 = (POINTARRAY *) 0x37f248
(gdb) print point->point->dims
$3 = 0 '\0'
(gdb) print point->point->npoints
$4 = 1
(gdb) n
531             p = (POINT2D *)getPoint(point->point, 0);
(gdb) print p
Cannot access memory at address 0xfffffff0
(gdb) n
533             PG_RETURN_FLOAT8(p->x);
(gdb) n

Program received signal SIGSEGV, Segmentation fault.
LWGEOM_x_point (fcinfo=0xffbed600) at lwgeom_ogc.c:533
533             PG_RETURN_FLOAT8(p->x);
(gdb) 
------------------------------------------------------------------

My understanding is that the POINTARRAY structure passed to the "getPoint"
function is somehow invalid... One obvious thing that I noticed (and I
might be way off track here, it's my first time reading through this
code...) is that the dimension is always 0, where this is noted in
the source files:

/size of point represeneted in the POINTARRAY
// 16 for 2d, 24 for 3d, 32 for 4d
int
pointArray_ptsize(const POINTARRAY *pa)
{
        return sizeof(double)*TYPE_NDIMS(pa->dims);
}

I also tested with LINESTRING and pointArray_ptsize will always return
0 here...


Any help is greatly appreciated!


Tuesday, February 8, 2005, 2:40:23 PM, you wrote:

II> Hello,

II> I've been having problems for a while with Postgis on Solaris 8
II> (sparc). I have tried various combinations of Postgresql 8.0.1, 7.4.6
II> with Postgis versions 0.9.1 and up.
II> The problem is that after the packages compile relatively without
II> hassle, I can't use any postgis spatial function without crashing the
II> database.
II> For example, I create an empty database, add the lwpostgis.sql
II> extension, create a spatial table with point geometry, insert one row
II> into the table... up to this point everything is fine... when I run
II> "select astext(geom) ..." the point shows up correctly, but when I
II> execute "select X(geom) ..." the backend crashes:


II> server closed the connection unexpectedly
II>          This probably means the server terminated abnormally
II>          before or while processing the request.
II> The connection to the server was lost. Attempting reset: Failed


II> I compiled with LDFLAGS="-lstdc++ -lgcc" and gcc  3.4.1.
II> My gcc installation is configured as follows:
II> Reading specs from
II> /a/perry/data/pkgs3/local/bin/../lib/gcc/sparc-sun-solaris2.8/3.4.1/specs
II> Configured with: ../configure --with-as=/usr/ccs/bin/as
II> --with-ld=/usr/ccs/bin/ld --disable-nls
II> Thread model: posix
II> gcc version 3.4.1

II> The compiler uses Sun's linker and I was wondering if this is part of
II> the problem... When I try to compile with GNU's ld, I get a
II> "option -dn and -P are incompatible" linker error.

II> The logs are not showing anything interesting, even with the highest
II> debug option set...
II> I also tried to debug the backend, but I get this error in gdb:
II>   Reading symbols from /usr/local/lib/libstdc++.so.6...Error
II> while reading shared library symbols:
II>   Dwarf Error: Cannot handle DW_FORM_strp in DWARF reader.



II> So, is anyone else using lwgeom Postgis on Solaris 8? Did you compile
II> gcc from scratch, or used the binaries from sunfreeware.com ?
II> Any ideas of what might go wrong with my installation?


II> Many thanks,
II> -----------------------------------------------
II> Dorel Ionut Iordache - <ionut at eps.berkeley.edu>
II> UC Berkeley - Earth & Planetary Science Dept.

II> _______________________________________________
II> postgis-users mailing list
II> postgis-users at postgis.refractions.net
II> http://postgis.refractions.net/mailman/listinfo/postgis-users



-- 
Best regards,
-----------------------------------------------
Dorel Ionut Iordache - <ionut at eps.berkeley.edu>
UC Berkeley - Earth & Planetary Science Dept.




More information about the postgis-users mailing list