[postgis-devel] C-Library function returning PostGIS point crashing backend

Sandro Santilli strk at keybit.net
Fri Jan 11 00:53:34 PST 2013


On Thu, Jan 10, 2013 at 02:29:31PM -0500, David Fuhry wrote:

> I built the latest stable versions of PostgreSQL (9.2.2) and PostGIS
> (2.0.2), both built with --enable-debug, on a different machine (RHEL 6)
> and following Paul's instructions, got the following backtrace showing the
> segfault occurring in pfree:

[...]

> Program received signal SIGSEGV, Segmentation fault.
> 0x000000000072488b in pfree (pointer=0xc63e40) at mcxt.c:659
> 659 (*header->context->methods->free_p) (header->context, pointer);

[...]

> I noticed that header->context->methods points (as do ->parent and ->name)
> to an invalid address:
> 
> (gdb) f 0
> #0  0x000000000072488b in pfree (pointer=0xc63e40) at mcxt.c:659
> 659 (*header->context->methods->free_p) (header->context, pointer);
> (gdb) p *header->context
> $8 = {type = 1237353800, methods = 0x7e01be000003c484, parent =
> 0x9a00e8c789480087, firstchild = 0xfa840fc08548ffd4, nextchild =
> 0x1c3883d0ff000002,
>   name = 0x279840fc58948 <Address 0x279840fc58948 out of bounds>, isReset =
> 0 '\000'}
> (gdb) p *header->context->methods
> Cannot access memory at address 0x7e01be000003c484
> 
> Suggestions?

Can it be a mismatch between postgresql-server headers at build time
and postgresql libraries at run time ? Any compile-time warning ?
Also try statically linking liblwgeom

--strk;



More information about the postgis-devel mailing list