Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Sep 1996 23:33:45 +1000 (EST)
From:      Darren Reed <avalon@coombs.anu.edu.au>
To:        avalon@coombs.anu.edu.au (Darren Reed)
Cc:        freebsd-bugs@freebsd.org, freebsd-hackers@freebsd.org
Subject:   Re: no more mbufs!
Message-ID:  <199609081335.GAA01258@who.cdrom.com>
In-Reply-To: <199609080811.AA08048@mail.crl.com> from "Darren Reed" at Sep 8, 96 06:07:23 pm

next in thread | previous in thread | raw e-mail | index | archive | help
In some mail from Darren Reed, sie said:
> 
> 
> Hi, I just made my 2.1.5 box run out of mbufs:
> 
> kernel: Out of mbuf clusters - increase maxusers!
> 
> so I thought I'd let it rest and wait for things to expire...
> 
> (a reboot is going to be necessary, I can see...)
> 
> however, netstat -m now looks like this:
> 1038 mbufs in use:
> 	1025 mbufs allocated to data
> 	2 mbufs allocated to packet headers
> 	3 mbufs allocated to protocol control blocks
> 	8 mbufs allocated to socket names and addresses
> 1024/1024 mbuf clusters in use
> 2177 Kbytes allocated to network (100% in use)
> 0 requests for memory deined
> 0 requests for memory delayed
> 0 calls to protocol drain queues
> 
> there appear to be no outstanding connections in netstat -an output.
> 
> To get the machine in this state, I was using it as the source of running
> iptest against an UltraSparc2 (making heavy use of sending packets out via
> BPF).
> 
> Some minutes later, "netstat -m" still reports the same.
> 
> Reboot time I guess: new kernel and has been up less than half an hour.

Sigh, and you know what ?  I've already got a patch for this amognst the
IP Filter patches for ip_input.c - guess this is why I never had a problem
until I put virgin 2.1.5 kernel on my box.  I didn't think of this until I
did up maxusers and did recreate the above situation.

Maybe someone will take this and commit it sometime...  discovered the bug
when I crashed my SunOS4 box, and managed to crash Ultrix too.  Seems like
it just fucks the mbufs on FreeBSD.  NetBSD fixed it when they rewrote
everything to use TAILQ, dunno about BSD/OS.

So IP Filter users, don't worry about the above bug report :-)

Darren


*** /sys/netinet/ip_input.c.orig	Wed Sep  6 20:31:35 1995
--- /sys/netinet/ip_input.c	Sun Apr 21 12:12:53 1996
***************
*** 507,512 ****
--- 523,530 ----
  	 * if they are completely covered, dequeue them.
  	 */
  	while (q != (struct ipasfrag *)fp && ip->ip_off + ip->ip_len > q->ip_off) {
+ 		struct mbuf *m0;
+ 
  		i = (ip->ip_off + ip->ip_len) - q->ip_off;
  		if (i < q->ip_len) {
  			q->ip_len -= i;
***************
*** 514,522 ****
  			m_adj(dtom(q), i);
  			break;
  		}
  		q = q->ipf_next;
- 		m_freem(dtom(q->ipf_prev));
  		ip_deq(q->ipf_prev);
  	}
  
  insert:
--- 532,541 ----
  			m_adj(dtom(q), i);
  			break;
  		}
+ 		m0 = dtom(q);
  		q = q->ipf_next;
  		ip_deq(q->ipf_prev);
+ 		m_freem(m0);
  	}
  
  insert:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609081335.GAA01258>