From owner-freebsd-current Thu Mar 13 0:20:23 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 853D737B401; Thu, 13 Mar 2003 00:20:19 -0800 (PST) Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E33B43F3F; Thu, 13 Mar 2003 00:20:14 -0800 (PST) (envelope-from ru@whale.sunbay.crimea.ua) Received: from whale.sunbay.crimea.ua (ru@localhost [127.0.0.1]) by whale.sunbay.crimea.ua (8.12.8/8.12.8/Sunbay) with ESMTP id h2D8JbFZ081506 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 13 Mar 2003 10:19:37 +0200 (EET) (envelope-from ru@whale.sunbay.crimea.ua) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.12.8/8.12.8/Submit) id h2D8JZmQ081501; Thu, 13 Mar 2003 10:19:35 +0200 (EET) (envelope-from ru) Date: Thu, 13 Mar 2003 10:19:35 +0200 From: Ruslan Ermilov To: Andrew Gallatin , Poul-Henning Kamp , Jeff Roberson Cc: current@FreeBSD.org Subject: INVARIANTS hide bugs (malloc/uma related)? (was: Re: latest working snapshot?) Message-ID: <20030313081935.GA79502@sunbay.com> References: <15983.34577.288499.704923@grasshopper.cs.duke.edu> <20030312203201.GB16361@sunbay.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kfjH4zxOES6UT95V" Content-Disposition: inline In-Reply-To: <20030312203201.GB16361@sunbay.com> User-Agent: Mutt/1.5.3i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --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