From root@niw.com.au  Mon Apr 10 02:31:55 2000
Return-Path: <root@niw.com.au>
Received: from rose.niw.com.au (app3022-2.gw.connect.com.au [203.63.119.4])
	by hub.freebsd.org (Postfix) with ESMTP id 4BE7C37B751
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 10 Apr 2000 02:31:53 -0700 (PDT)
	(envelope-from root@niw.com.au)
Received: by rose.niw.com.au (Postfix, from userid 0)
	id 70F1562D12; Mon, 10 Apr 2000 19:01:49 +0930 (CST)
Message-Id: <20000410093149.70F1562D12@rose.niw.com.au>
Date: Mon, 10 Apr 2000 19:01:49 +0930 (CST)
From: ian@niw.com.au
Sender: root@niw.com.au
Reply-To: ian@niw.com.au
To: FreeBSD-gnats-submit@freebsd.org
Subject: stale unix domain connections
X-Send-Pr-Version: 3.2

>Number:         17895
>Category:       kern
>Synopsis:       stale unix domain connections
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    dwmalone
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 10 02:40:02 PDT 2000
>Closed-Date:    Thu Feb 28 05:41:18 PST 2002
>Last-Modified:  Thu Feb 28 06:46:33 PST 2002
>Originator:     Ian West
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
SMP kernel, dual PIII-450, 256Megs Memory.

>Description:
Poorly written (alpha) code which opens a unix domain listener socket,
but which fail's to 'attach' in combination with a client attached to
this, can leave open connections which do not appear to time out when
the socket is closed due to a terminate.

I would guess that if enough of these were left laying around it could
eventually chew up enough resouces to cause problems.

netstat -an output follows

cde970c0 stream    0   0   0   0   0   0 /home/ian/tools/testsocket
cde97140 stream    0   0   0   0   0   0 /home/ian/tools/testsocket
cde97d80 stream    0   0   0   0   0   0 /home/ian/tools/testsocket
cde97f00 stream    0   0   0   0   0   0 /home/ian/tools/testsocket
cde97180 stream    0   0   0   0   0   0 /home/ian/tools/testsocket
cde974c0 stream   12   0   0   0   0   0 /home/ian/tools/testsocket
cde97640 stream    0   0   0   0   0   0 /home/ian/tools/testsocket
cde978c0 stream    1   0   0   0   0   0 /home/ian/tools/testsocket


>How-To-Repeat:
Open a unix domain socket for listen. Connect to it from a another
program, terminate the listener before the connection has been
'accepted' The connection seems to remain.

>Fix:
Unknown at this stage. I suspect a check needs to be made on
exit for open unix domain sockets ? Where are ipv4 domain sockets
checked ? do they just wait for a timeout ?


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: mike 
State-Changed-When: Sat Jul 21 18:24:56 PDT 2001 
State-Changed-Why:  

Does this problem still occur in newer versions of FreeBSD, 
such as 4.3-RELEASE? 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=17895 
Responsible-Changed-From-To: freebsd-bugs->dwmalone 
Responsible-Changed-By: dwmalone 
Responsible-Changed-When: Sun Jul 22 03:51:27 PDT 2001 
Responsible-Changed-Why:  
I've checked and it looks like this problem continues to exist in -current. 
I've been looking at unix domain stuff, so I'll take the PR. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=17895 
State-Changed-From-To: feedback->closed 
State-Changed-By: iedowse 
State-Changed-When: Thu Feb 28 05:41:18 PST 2002 
State-Changed-Why:  

Fixed in both -CURRENT and -STABLE (kern/uipc_usrreq.c rev 1.81). 
We had seen this locally ages ago with xdm when X was having trouble 
starting, but it was just when it happened to us again recently 
that I was reminded to investigate it. Looks like the bug was there 
since Feb 1999. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=17895 
>Unformatted:
