Tor Gunston <tor@tor.to> writes:
> 4) gdb backtrace shows the process stuck in malloc_consolidate:
> #0 0x42074d44 in malloc_consolidate () from /lib/tls/libc.so.6
> #1 0x420743c9 in _int_malloc () from /lib/tls/libc.so.6
> #2 0x4207378d in malloc () from /lib/tls/libc.so.6
This suggests to me that something has clobbered malloc's internal data
structures. The most common cause of such an error is writing past the
end of a memory block obtained from malloc; other likely causes are
writing on already-freed memory, and ye ever-popular plain old wild store.
> This seems like a bug in libpq to me, but since this is my first attempt
> at using Postgresql, I'm going to assume that I'm the idiot and post it
> here.
I think it much more likely to be a bug in your surrounding program.
If you can provide a simple test case that reproduces the problem,
though, we can investigate the possibility of a bug in libpq.
regards, tom lane