(lightbulb goes off) Re: sockstat not working

Erik P. Skaalerud erik at pentadon.com
Wed Feb 2 22:38:51 PST 2005


Matthew Dillon wrote:

   Ah ha!  I think I'm on to something here.  It looks like sysctl is being
   asked to report the buffer size but then the second call which fills the
   buffer is returning ENOMEM, meaning that the supplied buffer is not
   large enough, meaning that sysctl is not calculating the correct buffer
   size.
   I think what is going on is that the sysctl code in kern_descrip.c is
   not counting threaded processes (which share their descriptor tables)
   properly.
   Since your system has a lot of threaded processes, and my system doesn't,
   you are hitting the bug and I am not.
   Please try the enclosed patch.  I have committed this to HEAD as well
   and will slip the stable tag on it once I get confirmation that it
   fixes the problem.
					-Matt
					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>

Index: kern_descrip.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_descrip.c,v
retrieving revision 1.38
diff -u -r1.38 kern_descrip.c
--- kern_descrip.c	14 Jan 2005 19:28:10 -0000	1.38
+++ kern_descrip.c	2 Feb 2005 20:33:47 -0000
 

[snip]

Looks like this did the trick Matt, I think it safely can be slipped to 
Stable.

- Erik





More information about the Bugs mailing list