Subject: port-i386/23567: tcp socket gets stuck in CLOSE_WAIT after program crash
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <firstname.lastname@example.org>
Date: 11/25/2003 15:12:14
>Synopsis: tcp socket gets stuck in CLOSE_WAIT after program crash
>Arrival-Date: Tue Nov 25 15:13:00 UTC 2003
>Originator: Christopher Leidigh
>Release: 1.6.1 porti386
NetBSD cdlnetbsd.ams.apc.com 1.6.1 NetBSD 1.6.1 (GENERIC) #0: Tue Apr 8 12:05:52 UTC 2003 email@example.com:/autobuild/netbsd-1-6/i386/OBJ/autobuild/netbsd-1-6/src/sys/arch/i386/compile/GENERIC i386
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.
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.