From owner-freebsd-current Fri Jun 1 8:56: 2 2001 Delivered-To: freebsd-current@freebsd.org Received: from mail.yadt.co.uk (yadt.demon.co.uk [158.152.4.134]) by hub.freebsd.org (Postfix) with SMTP id EA9DF37B423 for ; Fri, 1 Jun 2001 08:55:54 -0700 (PDT) (envelope-from davidt@yadt.co.uk) Received: (qmail 65487 invoked from network); 1 Jun 2001 15:55:37 -0000 Received: from gattaca.local.yadt.co.uk (HELO mail.gattaca.yadt.co.uk) (qmailr@10.0.0.2) by xfiles.yadt.co.uk with SMTP; 1 Jun 2001 15:55:37 -0000 Received: (qmail 12913 invoked by uid 1000); 1 Jun 2001 15:55:51 -0000 Date: Fri, 1 Jun 2001 16:55:51 +0100 From: David Taylor To: Bruce Evans Cc: freebsd-current@FreeBSD.ORG, jhb@FreeBSD.ORG Subject: Re: gcc -pg causes 'kernel trap 12 with interrupts disabled' & panic Message-ID: <20010601165551.A12821@gattaca.yadt.co.uk> Mail-Followup-To: Bruce Evans , freebsd-current@FreeBSD.ORG, jhb@FreeBSD.ORG References: <20010530203509.A789@gattaca.yadt.co.uk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="3MwIy2ne0vdjdPXF" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from bde@zeta.org.au on Thu, May 31, 2001 at 23:26:24 +1000 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 --3MwIy2ne0vdjdPXF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, 31 May 2001, Bruce Evans wrote: > On Wed, 30 May 2001, David Taylor wrote: >=20 > > When trying to profile ircd-hybrid-7 on -CURRENT (I tried using a pre-vm > > madness version first, then tried a version cvsuped today), I reliably = get > > lots of: > >=20 > > kernel trap 12 with interrupts disabled > >=20 > > messages on the console (one every 5-10 seconds, when the ircd is reaso= nably > > loaded). >=20 > This is because ast() calls addupc_task() with sched_lock held. > addupc_task() calls copyin() and copyin() sometimes traps to fault in the > profiling buffer. >=20 > This seems to be just a bug in ast(). userret() is missing the bug. > Untested fix: >=20 > --- > Index: trap.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/i386/i386/trap.c,v > retrieving revision 1.189 > diff -u -1 -r1.189 trap.c > --- trap.c 2001/05/23 22:58:09 1.189 > +++ trap.c 2001/05/31 13:09:02 > @@ -1285,5 +1341,6 @@ > mtx_lock(&Giant); > - mtx_lock_spin(&sched_lock); > addupc_task(p, p->p_stats->p_prof.pr_addr, > p->p_stats->p_prof.pr_ticks); > + mtx_lock_spin(&sched_lock); > + /* XXX why not unlock Giant? */ > } > --- I tested this, and it works! No more `kernel trap 12 with interrupts disabled' messages, and also, thankfully, no more panics. (Related to this anyway, I'm still getting freelist corruption related things). =20 > I think this is caused by the same bug. >=20 > "kernel trap with interrupts disabled" >=20 > should be fatal (the case of trap 12 (only) _is_ fatal in my version), > but the kernel attempts to fix the problem and continue. This sort > of worked when things were locked by disabling interrupts. Now, things > may be locked by a spinlock as well as by disabling interrupts, and > the corresponding fixup would be to release the spinlock. But this > is more obviously wrong. >=20 > Bruce >=20 Yeah, just trying to cover up the problem and march on usually doesn't work out very well in computing.. or anywhere else, really.. --=20 David Taylor davidt@yadt.co.uk --3MwIy2ne0vdjdPXF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE7F7sHfIqKXSsJ/xERAnqzAJwOhdT7CD38+hHAztghaQH6XsqE9QCgisH0 9WatArxiMmZPkwk/V2APGp0= =eAgj -----END PGP SIGNATURE----- --3MwIy2ne0vdjdPXF-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message