Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Mar 2003 10:19:35 +0200
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        Andrew Gallatin <gallatin@cs.duke.edu>, Poul-Henning Kamp <phk@FreeBSD.org>, Jeff Roberson <jeff@FreeBSD.org>
Cc:        current@FreeBSD.org
Subject:   INVARIANTS hide bugs (malloc/uma related)? (was: Re: latest working snapshot?)
Message-ID:  <20030313081935.GA79502@sunbay.com>
In-Reply-To: <20030312203201.GB16361@sunbay.com>
References:  <15983.34577.288499.704923@grasshopper.cs.duke.edu> <20030312203201.GB16361@sunbay.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--kfjH4zxOES6UT95V
Content-Type: multipart/mixed; boundary="MfFXiAuoTsnnDAfZ"
Content-Disposition: inline


--MfFXiAuoTsnnDAfZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Mar 12, 2003 at 10:32:01PM +0200, Ruslan Ermilov wrote:
> On Wed, Mar 12, 2003 at 02:14:25PM -0500, Andrew Gallatin wrote:
> >=20
> > I need to install current on a new box that just arrived. =20
> > What's the latest working snapshot?
> >=20
> > 20030312-JPSNAP get about 40% of the way through the base install and
> > sysinstall complains about a bad realloc, and lets me hit a key to
> > reboot ;-(
> >=20
> You're just lucky.  Mine just panics.
>=20
OK, I've tracked it down to the following.  Kernels _without_
``options INVARIANTS'' exhibit random panics, most often right
after launching the init(8) process (or sysinstall(8), if this
is an installation).

Depending on the kernel layout (I think), I saw later panics
when attempting to mount /proc, or just hanging kernel.

The attached kernel config, which is derivative of the BOOTMFS
i386 kernel which we use during installation, is such example.

It took me a while to track the problem down to a single file,
and it turned out that compiling kern/kern_malloc.c with
INVARIANTS is enough to keep the system running.  Precisely,
this change did the trick:

%%%
Index: kern_malloc.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sys/kern/kern_malloc.c,v
retrieving revision 1.119
diff -u -p -r1.119 kern_malloc.c
--- kern_malloc.c	10 Mar 2003 20:24:54 -0000	1.119
+++ kern_malloc.c	13 Mar 2003 00:53:47 -0000
@@ -429,7 +429,7 @@ kmeminit(dummy)
 		char *name =3D kmemzones[indx].kz_name;
=20
 		kmemzones[indx].kz_zone =3D uma_zcreate(name, size,
-#ifdef INVARIANTS
+#if 1
 		    mtrash_ctor, mtrash_dtor, mtrash_init, mtrash_fini,
 #else
 		    NULL, NULL, NULL, NULL,
%%%


Cheers,
--=20
Ruslan Ermilov		Sysadmin and DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age

--MfFXiAuoTsnnDAfZ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=BOOTMFS

machine		i386
cpu		I686_CPU
ident		BOOTMFS
options 	SCHED_4BSD
options 	INET
options 	FFS
options 	COMPAT_43
#options 	INVARIANTS
options 	INVARIANT_SUPPORT
device		isa
device		pci
device		fdc
device		ata
device		atadisk
device		atapicd
options 	ATA_STATIC_ID
device		atkbdc
device		atkbd
device		psm
device		vga
device		sc
device		npx
device		loop
device		ether
options 	NO_COMPAT_FREEBSD4

--MfFXiAuoTsnnDAfZ--

--kfjH4zxOES6UT95V
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE+cD8XUkv4P6juNwoRArh5AJ4hG84wQjPX9Q7vAJcK/d5yAN97wACeJ0NX
yDCZne8bR+tRoSeJxQihYQQ=
=Dxxx
-----END PGP SIGNATURE-----

--kfjH4zxOES6UT95V--

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




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