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

strk at refractions.net strk at refractions.net
Thu Nov 10 23:51:14 PST 2005

Did you try fixing the memset line instead ?
The 2D code doesn't initialize the point because
it will be initialized by the subsequent memcpy,
while the 3d and 4d versions could leave
uninitialized values when the pointarray has less


On Fri, Nov 11, 2005 at 12:40:57AM +0100, Alex Mayrhofer wrote:
> 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
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel


 /"\    ASCII Ribbon Campaign
 \ /    Respect for open standards
  X     No HTML/RTF in email
 / \    No M$ Word docs in email

More information about the postgis-devel mailing list