Skip site navigation (1) Skip section navigation (2)

Re: BUG #2246: Bad malloc interactions: ecpg, openssl

From: Andrew Klosterman <andrew5(at)ece(dot)cmu(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2246: Bad malloc interactions: ecpg, openssl
Date: 2006-02-15 20:14:59
Message-ID: Pine.LNX.4.53L-ECE.CMU.EDU.0602151504410.31548@blossom.pdl.cmu.edu (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-patches
On Wed, 15 Feb 2006, Tom Lane wrote:

> Andrew Klosterman <andrew5(at)ece(dot)cmu(dot)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(at)ece(dot)cmu(dot)edu

In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2006-02-15 20:23:38
Subject: Re: BUG #2246: Only call pg_fe_getauthname if none given
Previous:From: Stephen FrostDate: 2006-02-15 20:05:26
Subject: Re: BUG #2246: Only call pg_fe_getauthname if none given

pgsql-patches by date

Next:From: Tom LaneDate: 2006-02-15 20:23:38
Subject: Re: BUG #2246: Only call pg_fe_getauthname if none given
Previous:From: Stephen FrostDate: 2006-02-15 20:05:26
Subject: Re: BUG #2246: Only call pg_fe_getauthname if none given

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group