[postgis-devel] crash (somehow) resolved (was: different EWKB representations on different machines?)

Alex Mayrhofer axelm-postgis at nona.net
Thu Nov 10 15:40:57 PST 2005


strk at refractions.net wrote:
> Yes, printf debugging is the way to go.
> It's lwnotice() in this case, same signature as printf().

Ok, i've tracked it down to:

Program received signal SIGBUS, Bus error.
getPoint4d_p (pa=0x3af658, n=0, point=0x3af515) at lwgeom_api.c:445
445             memset(point, 0, sizeof(POINT3DZ));
(gdb) bt
#0  getPoint4d_p (pa=0x3af658, n=0, point=0x3af515) at lwgeom_api.c:445
#1  0x7107db94 in lwpoint_serialize_buf (point=0x3af678, buf=0x3af510 "q",
     retsize=0xefffe7f4) at lwpoint.c:85
#2  0x7107da08 in lwpoint_serialize (point=0x3af678) at lwpoint.c:21
#3  0x7108e75c in LWGEOM_pointn_linestring (fcinfo=0xefffe8e8)
     at lwgeom_ogc.c:546

[...]

i've tried to figure out what goes wrong in the memset() call - i didn't 
find an abvious problem (besides that the 4D code uses "sizeof(POINT3DM)", 
which is probably 8 bytes too few).

However, when i desperately tried to _remove_ the memset line from the code 
(and the similar line around lwgeom_api.c:496) my query suddenly works (i 
was inspired to do that because the 2D code around lwgeom_api.c:557 does 
_not_ initialize the point before copying it...)

So, the problem is solved for me - anybody sparc-savvy here who could 
enlighten me?

cheers

alex



More information about the postgis-devel mailing list