Subject: port-i386/23567: tcp socket gets stuck in CLOSE_WAIT after program crash
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <cleidigh@apcc.com>
List: netbsd-bugs
Date: 11/25/2003 15:12:14
>Number:         23567
>Category:       port-i386
>Synopsis:       tcp socket gets stuck in CLOSE_WAIT after program crash
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 25 15:13:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Christopher Leidigh
>Release:        1.6.1 porti386
>Organization:
APC
>Environment:
NetBSD cdlnetbsd.ams.apc.com 1.6.1 NetBSD 1.6.1 (GENERIC) #0: Tue Apr  8 12:05:52 UTC 2003     autobuild@tgm.daemon.org:/autobuild/netbsd-1-6/i386/OBJ/autobuild/netbsd-1-6/src/sys/arch/i386/compile/GENERIC i386
-bash-2.05b$


>Description:
A simple web server program under development crashes at times (it's not done) and this has resulted in tcp sockets stuck in a CLOSE_WAIT state.  This has happened several times and so far the only recourse is a full reboot.  network restart does not appear to clear the socket table. The sockets in question are opened with SO_REUSEADDR socket option  

Searches reveal this was a problem several years ago but apprears to persist in 1.6.1.
>How-To-Repeat:
Currently it is not clear if there are any exact circumstances to cause the problem.  A program with a server socket in SO_REUSEADDR set that has had at least one connection crashes and the tcp connection gets caught in the CLOSE_WAIT state.  Any program wishing to open a server socket on that port will fail.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted: