Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Feb 2002 20:21:34 +0000
From:      Ian Dowse <iedowse@maths.tcd.ie>
To:        "Jan L. Peterson" <jlp@softhome.net>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: crashes on 4.5-RELEASE 
Message-ID:   <200202232021.aa04276@salmon.maths.tcd.ie>
In-Reply-To: Your message of "Thu, 21 Feb 2002 15:10:44 MST." <20020221221044.D11E8422D0@mail.flipdog.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20020221221044.D11E8422D0@mail.flipdog.com>, "Jan L. Peterson" writ
es:
>The machine panics (sometimes right away, sometimes after several 
>minutes).  Here's the panic message:
>
>kernel: type 12 trap, code=0
>Stopped at	nfs_realign+0xdb:	incb	0(%eax,%edx,1)

It looks like some junk cluster pointer is ending up on the mbuf
cluster freelist. Try adding "options INVARIANTS" and "options
INVARIANT_SUPPORT" to your kernel config, and apply the following
patch in /usr/src/sys/sys. This won't fix the panics, but it should
hopefully narrow down the cause by panicking at the point that the
bad cluster pointer is first seen. Try to get a few stack traces
with this patch in place.

Ian

Index: mbuf.h
===================================================================
RCS file: /dump/FreeBSD-CVS/src/sys/sys/mbuf.h,v
retrieving revision 1.44.2.12
diff -u -r1.44.2.12 mbuf.h
--- mbuf.h	13 Feb 2002 00:43:11 -0000	1.44.2.12
+++ mbuf.h	20 Feb 2002 00:53:36 -0000
@@ -366,6 +366,10 @@
 		else							\
 			(p) = NULL;					\
 	}								\
+	KASSERT((p) == NULL || ((char *)(p) >= (char *)mbutl &&		\
+	    (char *)(p) < (char *)mbutl + 				\
+	    mbstat.m_clusters * MCLBYTES + mbstat.m_mbufs * MSIZE),	\
+	    ("MCLALLOC: bad cluster %p", (p)));				\
 } while (0)	
 
 #define	MCLGET(m, how) do {						\
@@ -384,6 +388,10 @@
 #define	MCLFREE1(p) do {						\
 	union mcluster *_mp = (union mcluster *)(p);			\
 									\
+	KASSERT((char *)(p) >= (char *)mbutl &&				\
+	    (char *)(p) < (char *)mbutl + 				\
+	    mbstat.m_clusters * MCLBYTES + mbstat.m_mbufs * MSIZE,	\
+	    ("MCLFREE1: bad cluster %p", (p)));				\
 	KASSERT(mclrefcnt[mtocl(_mp)] > 0, ("freeing free cluster"));	\
 	if (--mclrefcnt[mtocl(_mp)] == 0) {				\
 		_mp->mcl_next = mclfree;				\

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




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