Re: BUG #2246: Bad malloc interactions: ecpg, openssl - Mailing list pgsql-bugs

From Andrew Klosterman
Subject Re: BUG #2246: Bad malloc interactions: ecpg, openssl
Date
Msg-id Pine.LNX.4.53L-ECE.CMU.EDU.0602151504410.31548@blossom.pdl.cmu.edu
Whole thread Raw
In response to Re: BUG #2246: Bad malloc interactions: ecpg, openssl  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Wed, 15 Feb 2006, Tom Lane wrote:

> Andrew Klosterman <andrew5@ece.cmu.edu> writes:
> > With the debug binaries, I was able to step through the program and get to
> > what appears to be the function where it bails:  line 1166 of
> > postgresql-8.1.0/src/interfaces/libpq/fe-secure.c where SSL_free() is
> > called.
>
> BTW, is the address that glibc says is corrupted consistent from run to
> run?  If so, you could narrow down the problem pretty quickly by setting
> a hardware watchpoint on that address with gdb.  Any hits that are not
> from the malloc subroutines are probably the source of the problem.
>
>             regards, tom lane

The address given by the error message is consistent.  But, setting a
break/watch point for it has been troublesome.

A watchpoint can't be set until the memory is mapped in.  I have narrowed
down the time that the memory is mapped in to being somewhere in a call to
PQconnectPoll() from within connectDBComplete() in
src/interfaces/libpq/fe-connect.c.  With the watchpoint set, though, the
debugger isn't breaking the execution of the program until the error
manifests itself.

Digging around, I can't come up with a way to get information on the
arguments and return results from malloc() every time it is called.
"strace" only does system calls.  The output I get from "ltrace" is not
useful and no options I can see appear to improve the situation.

So, I'm kinda stuck.  This bug might be one that gets away...

--Andrew J. Klosterman
andrew5@ece.cmu.edu

pgsql-bugs by date:

Previous
From: "Gerhard Lutz"
Date:
Subject: BUG #2267: Accessing large objects via ODBC
Next
From: "Gerhard Lutz"
Date:
Subject: BUG #2265: CREATE TABLE when AUTOCOMMIT is OFF