[postgis-devel] C-Library function returning PostGIS point crashing backend
Mark Cave-Ayland
mark.cave-ayland at ilande.co.uk
Mon Jan 14 20:36:23 PST 2013
On 15/01/13 03:19, David Fuhry wrote:
> Not sure if this reveals anything more, but here's the valgrind output.
> Apparently the segfault is of reading 16 bytes before the memory
> location malloced in lwgeom_to_wkb, I don't know if that's a coincidence
> or not.
Hi Dave,
Did you build your copy of PostgreSQL yourself? If you're doing any
serious development work in C using PostgreSQL you need to build
yourself a copy from source with the following options passed to configure:
--enable-cassert --enable-debug
Whilst not recommended for production, these options include additional
assertion/memory checks within the binaries; in particular they add
memory guards so that the very first time you access an unallocated
section of memory, you'll get an immediate assertion pointing to the
culprit rather than waiting for you to accidentally clobber an internal
structure and cause a crash.
HTH,
Mark.
More information about the postgis-devel
mailing list