The sonewconn listen queue overflow issue

Mikolaj Golub trociny at FreeBSD.org
Sun Feb 16 21:58:48 UTC 2014


On Mon, Feb 03, 2014 at 08:33:11PM +0100, Photo stuff wrote:

>   sonewconn: pcb 0xyyyyyyyyyyyyyyyy: Listen queue overflow: 8 already in
> queue awaiting acceptance
> 
> I searched a bit on the web and came across recommendations to try
> netstat -nAa to find out which program this came from.
> 
> Well, running netstat -nAa |grep pcb 0xyyyyyyyyyyyyyyyy in a loop didn't
> work, it didn't give any output even though the messages kept coming in
> the log during that time.

Unfortunately, netstat(1) shows tcpcb address for TCP sockets, while
in debug messages like above the socket's pcb is printed.

It looks like the simplest way to assiciate a socket with the reported
pcb address is to hack netstat(1) to output pcb instead of tcpcb:

Index: usr.bin/netstat/inet.c
===================================================================
--- usr.bin/netstat/inet.c	(revision 261639)
+++ usr.bin/netstat/inet.c	(working copy)
@@ -448,7 +448,7 @@ protopr(u_long off, const char *name, int af1, int
 		if (Lflag && so->so_qlimit == 0)
 			continue;
 		if (Aflag) {
-			if (istcp)
+			if (0 && istcp)
 				printf("%*lx ", 2 * (int)sizeof(void *), (u_long)inp->inp_ppcb);
 			else
 				printf("%*lx ", 2 * (int)sizeof(void *), (u_long)so->so_pcb);

-- 
Mikolaj Golub


More information about the freebsd-hackers mailing list