Re: Seg fault on PQconnectdb

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe La Frite <joelafrite84(at)gmail(dot)com>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Seg fault on PQconnectdb
Date: 2010-10-13 15:02:58
Message-ID: 26237.1286982178@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Joe La Frite <joelafrite84(at)gmail(dot)com> writes:
> Tough after some testing, I'm fairly sure the problem isn't caused by
> libpq at all. I think the heap gets corrupted at some point before the
> call to PQconnectdb is made, as replacing the call by a simple void*
> test = malloc(10) causes it to crash as well.

Yeah, a crash inside malloc almost certainly means that you've stomped
on some of malloc's internal data structures, probably by overrunning
the allocated size of some malloc'd data chunk. I'd suggest valgrind,
ElectricFence, or similar for locating the offending code.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Geoffrey Myers 2010-10-13 15:17:40 pitr question
Previous Message Tom Lane 2010-10-13 14:38:59 Re: Understanding PostgreSQL Storage Engines