Re: BUG #1736: endless loop in PQconnectdb - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #1736: endless loop in PQconnectdb
Date
Msg-id 4594.1120406241@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #1736: endless loop in PQconnectdb  (Karsten Desler <kdesler@soohrt.org>)
Responses Re: BUG #1736: endless loop in PQconnectdb  (Karsten Desler <kdesler@soohrt.org>)
List pgsql-bugs
Karsten Desler <kdesler@soohrt.org> writes:
> * Bruce Momjian wrote:
>> I think what you are seeing is that the getaddrinfo memory is placed in
>> the PGconn structure that isn't freed until PQclear is called.  Does
>> your test call PQclear()?

> s/PQclear/PQfinish/
> It does call PQclear on the result, and PQfinish on the connection.

In that case I think there is no doubt that you've found a bug in
getaddrinfo/freeaddrinfo, and you ought to be reporting it to your
libc provider.  We do call freeaddrinfo on the result of getaddrinfo,
so if not everything is cleaned up, that's a library bug not ours.

You could check this by reducing the test case to getaddrinfo()
then freeaddrinfo() using the same parameters that fe-connect.c
passes.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Karsten Desler
Date:
Subject: Re: BUG #1736: endless loop in PQconnectdb
Next
From: Alvaro Herrera
Date:
Subject: Re: BUG #1748: Unique contraints cannot be added to long text fields