![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I've got a pretty flaky tcpip connection to a Postgres 7.4.7 database server and often times (once or twice a day) my program gets stuck in an endless busy-loop in PGconnectdb. |
#3
| |||
| |||
|
|
"Karsten Desler" <pgsql (AT) soohrt (DOT) org> writes: I've got a pretty flaky tcpip connection to a Postgres 7.4.7 database server and often times (once or twice a day) my program gets stuck in an endless busy-loop in PGconnectdb. Hmm. Maybe you have a test case for the proposed patch for bug #1467? Please see the patch posted in pgsql-patches a couple days ago, and let us know if it helps. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your message can get through to the mailing list cleanly |
#4
| |||
| |||
|
|
Yes, please --- the patch is at: http://archives.postgresql.org/pgsql...6/msg00486.php |
#5
| |||
| |||
|
|
* Bruce Momjian wrote: Yes, please --- the patch is at: http://archives.postgresql.org/pgsql...6/msg00486.php Thanks. I've applied the patch now, and I'll keep you posted. |
#6
| |||
| |||
|
|
* Karsten Desler wrote: * Bruce Momjian wrote: Yes, please --- the patch is at: http://archives.postgresql.org/pgsql...6/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) |
#7
| |||
| |||
|
|
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()? |
#8
| |||
| |||
|
|
* 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. |
#9
| |||
| |||
|
|
Karsten Desler <kdesler (AT) soohrt (DOT) 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. |
![]() |
| Thread Tools | |
| Display Modes | |
| |