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

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

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Andrew Klosterman <andrew5(at)ece(dot)cmu(dot)edu>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2246: Bad malloc interactions: ecpg, openssl
Date: 2006-02-14 20:14:13
Message-ID: 20060214201413.GH4474@ns.snowman.net (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-patches
* Andrew Klosterman (andrew5(at)ece(dot)cmu(dot)edu) wrote:
> Alright, I have built a system with the symbols left into the binaries.
[...]
> Again, it is showing a bad malloc in what appears to be some code using
> kerberos.  But there's nothing in my setup that I can think of right now
> that should induce a connection to be set up using kerberos.

The Kerberos libraries are still called when support for them has been
compiled in.  They generally don't cause any problems though.  For some
reason the line numbers in the backtrace line up but the function names
don't quite (perhaps inlineing).  Anyhow, the error is being reported
down in 'krb5_init_context()' so either something strange is happening
or it's actually a Kerberos bug after all.  The reason the Kerberos
libraries are called is to get the 'username' to use, which is
determined prior to actually connecting to the backend (and finding
out what authentication mechanism the backend thinks we should be
trying).

It's kind of a chicken-and-egg here because the backend decides what
authentication mechanism to ask for based off the username (at least in
part) through pg_hba.conf, so you can't find out the authentication
method until you know the username so all methods to find the username
have to be exhausted.  You could avoid this by explicitly passing
'user=' into the connection parameters though...  Would be interesting
to know what happens then...

Might also be interesting to look into the Kerberos libraries to see why
they're attempting to malloc(0), perhaps there's a bug there when
Kerberos isn't set up on the machine?

	Thanks,

		Stephen

In response to

Responses

pgsql-bugs by date

Next:From: Andrew KlostermanDate: 2006-02-14 20:25:06
Subject: Re: BUG #2246: Bad malloc interactions: ecpg, openssl
Previous:From: Andrew KlostermanDate: 2006-02-14 19:52:02
Subject: Re: BUG #2246: Bad malloc interactions: ecpg, openssl

pgsql-patches by date

Next:From: Andrew KlostermanDate: 2006-02-14 20:25:06
Subject: Re: BUG #2246: Bad malloc interactions: ecpg, openssl
Previous:From: Andrew KlostermanDate: 2006-02-14 19:52:02
Subject: Re: BUG #2246: Bad malloc interactions: ecpg, openssl

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