Newsgroups: bit.listserv.ibmtcp-l
Date:         Fri, 13 Nov 1992 09:13:06 -0500
From:         Bill Bormann <ad2@EXPERT.CC.PURDUE.EDU>
Subject:      Server hangs with connections in Close-Wait state

I'm trying to figure out a problem with our FINGER server.  I recently
converted it from the old Pascal API interface to SAS/C sockets.
Unfortunately, I am seeing a nasty problem I just can't figure out.  At
seemingly random intervals the server hangs, and (typically) NETSTAT SOCKETS
reveals something like this:

Name: FINGSERV     Subtask: SASCL3dc   Path id: 1
0    Stream  *..79                                                   L
0    Stream  VM.CC.PURDUE.EDU..79 CAPELLA.CS.PURDUE.EDU..4832Close-waitLC 1047
0    Stream  VM.CC.PURDUE.EDU..79 EN.ECN.PURDUE.EDU..3536Close-wait  LC   1062
0    Stream  VM.CC.PURDUE.EDU..79 Not connected         Closed       LC   1119
0    Stream  VM.CC.PURDUE.EDU..79 GN.ECN.PURDUE.EDU..2024Close-wait  LC   1201
0    Stream  VM.CC.PURDUE.EDU..79 GN.ECN.PURDUE.EDU..2025Close-wait  LC   1163
0    Stream  VM.CC.PURDUE.EDU..79 Not connected         Closed       LC   1158
0    Stream  VM.CC.PURDUE.EDU..79 SILVER.UCS.INDIANA.EDU..1365Close-waitLC1074
0    Stream  VM.CC.PURDUE.EDU..79 SILVER.UCS.INDIANA.EDU..1394Close-waitLC1057
0    Stream  VM.CC.PURDUE.EDU..79 SAGE.CC.PURDUE.EDU..1663Close-wait LC   1078
0    Stream  VM.CC.PURDUE.EDU..79 129.74.20.9..4841     Close-wait   LC   1031
1    Stream  VM.CC.PURDUE.EDU..79 Not connected         Closed            1076
2    Stream  VM.CC.PURDUE.EDU..79 Not connected         Closed            1001
3    Stream  VM.CC.PURDUE.EDU..79 Not connected         Closed            1081
4    Stream  VM.CC.PURDUE.EDU..79 Not connected         Closed            1091
5    Stream  VM.CC.PURDUE.EDU..79 Not connected         Closed            1000
6    Stream  VM.CC.PURDUE.EDU..79 Not connected         Closed            1107
7    Stream  VM.CC.PURDUE.EDU..79 Not connected         Closed            1178
8    Stream  VM.CC.PURDUE.EDU..79 Not connected         Closed            1045
9    Stream  VM.CC.PURDUE.EDU..79 Not connected         Closed            1180
10   Stream  VM.CC.PURDUE.EDU..79 Not connected         Closed            1115
11   Stream  VM.CC.PURDUE.EDU..79 Not connected         Closed            1025
12   Stream  VM.CC.PURDUE.EDU..79 Not connected         Closed            1020
13   Stream  VM.CC.PURDUE.EDU..79 Not connected         Closed            1174
14   Stream  VM.CC.PURDUE.EDU..79 Not connected         Closed            1129
15   Stream  VM.CC.PURDUE.EDU..79 Not connected         Closed            1072
16   Stream  VM.CC.PURDUE.EDU..79 Not connected         Closed            1204
17   Stream  VM.CC.PURDUE.EDU..79 Not connected         Closed            1040
18   Stream  VM.CC.PURDUE.EDU..79 Not connected         Closed            1087
19   Stream  VM.CC.PURDUE.EDU..79 Not connected         Closed            1071
20   Stream  VM.CC.PURDUE.EDU..79 Not connected         Closed            1154
21   Stream  VM.CC.PURDUE.EDU..79 UOFT02.UTOLEDO.EDU..4838Close-wait      1110

By individually dropping the connections in Close-wait state, the server
drops enters a select() state, and when the select() times out, it re-enters
a blocking accept().

I'd appreciate any clues as to what, in the code, might be causing this
problem.