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

From Karsten Desler
Subject Re: BUG #1736: endless loop in PQconnectdb
Date
Msg-id 20050703164920.GA1892@soohrt.org
Whole thread Raw
In response to Re: BUG #1736: endless loop in PQconnectdb  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
* Tom Lane wrote:
> 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.

Indeed. Sorry for the noise.
The GNU libc 2.3.2 leaks ai->ai_canonname for every struct addrinfo
in the result list.

The original problem hasn't happened again (it seems like the faulty
ethernet switch, that was the cause for the flaky connection was
finally replaced). Anyway, if it happenes again, I'll notify you.

Regards,
 Karsten Desler

pgsql-bugs by date:

Previous
From: Szűcs Gábor
Date:
Subject: Re: Select on pkey returned more than one row
Next
From: "Bartłomiej Rychtarski"
Date:
Subject: BUG #1750: recurrentive views terminates connection