Socket leak (Was: Re: What triggers "No Buffer Space) Available"?

Robert Watson rwatson at FreeBSD.org
Tue May 8 10:28:17 UTC 2007


On Tue, 8 May 2007, Marc G. Fournier wrote:

> So, over 7000 sockets with pretty much all processes shut down ...
>
> Shouldn't the garbage collector be cutting in somewhere here?
>
> I'm willing to shut everthing down like this again the next time it happens 
> (in 2-3 days) if someone has some other command / output they'd like fo rme 
> to provide the output of?
>
> And, I have the following outputs as of the above, where everythign is 
> shutdown and its running on minimal processes:

I think there may be a bug in the MFC of the UNIX domain socket reference 
count changes in RELENG_6:

   revision 1.155.2.8
   date: 2007/01/12 16:24:23;  author: jhb;  state: Exp;  lines: +36 -7
   MFC: Close a race between enumerating UNIX domain socket pcb structures via
   sysctl and socket teardown.  Note that we engage in a bit of trickery to
   preserve the ABI of 'struct unpcb' in 6.x.  We change the UMA zone to hold
   a 'struct unpcb_wrapper' which holds a 6.x 'struct unpcb' followed by the
   new reference count needed for handling the race.  We then cast 'struct
   unpcb' pointers to 'struct unpcb_wrapper' pointers when we need to access
   the reference count.

   Submitted by:   ups (including the ABI trickery)

Could you try backing this out locally and see if the problem goes away?  I've 
forwarded the information you sent to me previously to Stephan so he can take 
a look.

Robert N M Watson
Computer Laboratory
University of Cambridge


More information about the freebsd-stable mailing list