From owner-freebsd-current Thu May 31 10: 4:14 2001 Delivered-To: freebsd-current@freebsd.org Received: from pike.osd.bsdi.com (pike.osd.bsdi.com [204.216.28.222]) by hub.freebsd.org (Postfix) with ESMTP id 9B39A37B422 for ; Thu, 31 May 2001 10:04:05 -0700 (PDT) (envelope-from jhb@foo.osd.bsdi.com) Received: from foo.osd.bsdi.com (root@foo.osd.bsdi.com [204.216.28.137]) by pike.osd.bsdi.com (8.11.1/8.9.3) with ESMTP id f4VH3sK93373; Thu, 31 May 2001 10:03:55 -0700 (PDT) (envelope-from jhb@foo.osd.bsdi.com) Received: (from jhb@localhost) by foo.osd.bsdi.com (8.11.1/8.11.1) id f4VH3ru62109; Thu, 31 May 2001 10:03:53 -0700 (PDT) (envelope-from jhb) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Thu, 31 May 2001 10:03:53 -0700 (PDT) From: John Baldwin To: Bruce Evans Subject: Re: gcc -pg causes 'kernel trap 12 with interrupts disabled' & p Cc: freebsd-current@FreeBSD.ORG, David Taylor 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 On 31-May-01 Bruce Evans wrote: > On Wed, 30 May 2001, David Taylor wrote: > >> 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: >> >> kernel trap 12 with interrupts disabled >> >> messages on the console (one every 5-10 seconds, when the ircd is reasonably >> loaded). > > 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. > > This seems to be just a bug in ast(). userret() is missing the bug. > Untested fix: I think I have some comments in my local code about that sched_lock being bogus. :-/ I'll commit a fix for all platforms today. > --- > Index: trap.c > =================================================================== > 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? */ To avoid releasing it just to possibly grab it again afterwards I think, but I'll have to look at this again. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.Baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message