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 20050630082311.GA28108@soohrt.org
Whole thread Raw
In response to Re: BUG #1736: endless loop in PQconnectdb  (Karsten Desler <pgsql@soohrt.org>)
Responses Re: BUG #1736: endless loop in PQconnectdb
List pgsql-bugs
* Karsten Desler wrote:
> * Bruce Momjian wrote:
> > Yes, please --- the patch is at:
> >
> >     http://archives.postgresql.org/pgsql-patches/2005-06/msg00486.php
>
> Thanks.
> I've applied the patch now, and I'll keep you posted.

It doesn't seem to have helped, and while poking around a little, I
found another annoyance. libpq seems to leak memory if I pass a dns name as
host in conninfo. It doesn't leak when I do the getaddrinfo myself and pass
an IP.

root     16580  0.0  0.2  4004 1304 ?        S    10:07   0:00 monitor xxx.xxx.xxx.xxx
root     22434  0.0  1.9 47328 9240 ?        S    Jun07   5:42 monitor xxx.xxx.xxx.yyy

==9980== 4648 bytes in 166 blocks are definitely lost in loss record 4 of 4
==9980==    at 0x1B90459D: malloc (vg_replace_malloc.c:130)
==9980==    by 0x1BC39E3B: (within /lib/tls/i686/cmov/libresolv-2.3.2.so)
==9980==    by 0x1BC38B92: __libc_res_nquery (in /lib/tls/i686/cmov/libresolv-2.3.2.so)
==9980==    by 0x1BC39289: (within /lib/tls/i686/cmov/libresolv-2.3.2.so)
==9980==    by 0x1BC38E8F: __libc_res_nsearch (in /lib/tls/i686/cmov/libresolv-2.3.2.so)
==9980==    by 0x1BDA907D: ???
==9980==    by 0x1B9F0A65: (within /lib/tls/i686/cmov/libc-2.3.2.so)
==9980==    by 0x1B9F1673: getaddrinfo (in /lib/tls/i686/cmov/libc-2.3.2.so)
==9980==    by 0x1B9259A1: getaddrinfo_all (in /usr/lib/libpq.so.3.1)
==9980==    by 0x1B916F3B: (within /usr/lib/libpq.so.3.1)
==9980==    by 0x1B9164E9: PQconnectStart (in /usr/lib/libpq.so.3.1)
==9980==    by 0x1B916471: PQconnectdb (in /usr/lib/libpq.so.3.1)

Best regards,
 Karsten Desler

pgsql-bugs by date:

Previous
From: "庞劲松@GDLC技术部"
Date:
Subject: Bugs
Next
From: Chris Travers
Date:
Subject: Bug report regarding reconcilliation