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

Поиск
Список
Период
Сортировка
От Andrew Klosterman
Тема Re: BUG #2246: Bad malloc interactions: ecpg, openssl
Дата
Msg-id Pine.LNX.4.53L-ECE.CMU.EDU.0602131419370.18395@blossom.pdl.cmu.edu
обсуждение исходный текст
Ответ на Re: BUG #2246: Bad malloc interactions: ecpg, openssl  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Wed, 8 Feb 2006, Tom Lane wrote:

> "Andy Klosterman" <andrew5@ece.cmu.edu> writes:
> > SPECULATION: Another possibility is that I misunderstand some aspect of
> > multi-threaded interactions with Postgres (I open uniquely named connections
> > to the DB for each thread of my test program).  Maybe I need to have a
> > "lock" around the code that makes DB connections and make sure that only one
> > happens at a time (might be better handled within Postgres/SSL if that is
> > the case).
>
> There could be some re-entrancy problem in the SSL connection startup
> code --- if you add such a lock, does it get more reliable?  Also, did
> you remember to build PG with --enable-thread-safety ?
>
>             regards, tom lane

(I'm back after a bit of an illness.  Much better now!)

I threw in a pthread mutex around the code making the database connections
for each of my threads.  The problem is still there ("corrupted
double-linked list").

Even tuning things down and instructing my code to only run a single
pthread manifests the problem over an SSL connection.  Everything is just
fine without SSL.  Other code I've written works just fine with (and
without) threads connecting to the database with (and without) SSL.
Tracking down exactly what's tickling the problem in this case could be
tricky...

I'm using the pre-built debian testing packages, not self-compiled code,
for my postgres installation.  From the information I can gather from the
debian build logs (http://buildd.debian.org/build.php), everything was
configured and built with threads enabled.

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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Andrew Klosterman
Дата:
Сообщение: Re: BUG #2246: Bad malloc interactions: ecpg, openssl
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: BUG #2246: Bad malloc interactions: ecpg, openssl