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

From Karsten Desler
Subject BUG #1736: endless loop in PQconnectdb
Date
Msg-id 20050628153949.8AAAFF0AC8@svr2.postgresql.org
Whole thread Raw
Responses Re: BUG #1736: endless loop in PQconnectdb
List pgsql-bugs
The following bug has been logged online:

Bug reference:      1736
Logged by:          Karsten Desler
Email address:      pgsql@soohrt.org
PostgreSQL version: 7.4.7
Operating system:   debian sarge
Description:        endless loop in PQconnectdb
Details:

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.

An excerpt from a strace:
poll([{fd=389, events=POLLIN|POLLERR, revents=POLLIN|POLLERR|POLLHUP}], 1,
-1) = 1
recv(389, "", 1, 0)                     = 0
poll([{fd=389, events=POLLIN|POLLERR, revents=POLLIN|POLLERR|POLLHUP}], 1,
-1) = 1
recv(389, "", 1, 0)                     = 0
...

SSL is not involved. Sadly I can't say how far along in the connection
process the bug is triggered, but I could install a libpq3 with debugging
symbols and add a few strategically placed gdb watch/break points, if
needed.

pgsql-bugs by date:

Previous
From: Andreas Pflug
Date:
Subject: Re: row number -1 is out of range 0..-1
Next
From: Tom Lane
Date:
Subject: Re: BUG #1736: endless loop in PQconnectdb