From owner-freebsd-sparc64@FreeBSD.ORG Sun Feb 1 08:48:29 2004 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BA5BF16A4CE for ; Sun, 1 Feb 2004 08:48:29 -0800 (PST) Received: from mail.gmx.net (imap.gmx.net [213.165.64.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 2269643D2D for ; Sun, 1 Feb 2004 08:48:27 -0800 (PST) (envelope-from tmoestl@gmx.net) Received: (qmail 2874 invoked by uid 65534); 1 Feb 2004 16:48:25 -0000 Received: from p508E672B.dip.t-dialin.net (EHLO timesink.dyndns.org) (80.142.103.43) by mail.gmx.net (mp008) with SMTP; 01 Feb 2004 17:48:25 +0100 X-Authenticated: #5374206 Received: by rota (Postfix, from userid 1001) id 7032ACB; Sun, 1 Feb 2004 17:49:50 +0100 (CET) Date: Sun, 1 Feb 2004 17:49:50 +0100 From: Thomas Moestl To: Kris Kennaway Message-ID: <20040201164950.GB713@timesink.dyndns.org> References: <20040201105032.GA17856@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="RnlQjJ0d97Da+TV1" Content-Disposition: inline In-Reply-To: <20040201105032.GA17856@xor.obsecurity.org> User-Agent: Mutt/1.5.5.1i cc: sparc64@freebsd.org Subject: Re: "panic: trap: fast data access mmu miss" on 5.2-C X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2004 16:48:29 -0000 --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, 2004/02/01 at 02:50:32 -0800, Kris Kennaway wrote: > I updated the sparc64 package clients to 5.2-CURRENT 2 days ago, and > one of them panicked today: > > panic: trap: fast data access mmu miss > at line 364 in file /var/portbuild/sparc64/src-client/sys/sparc64/sparc64/trap.c > cpuid = 0; > Debugger("panic") > Stopped at Debugger+0x1c: ta %xcc, 1 > db> trace > __panic() at __panic+0x17c > trap() at trap+0x3f0 > -- fast data access mmu miss tar=0x4410000000 %o7=0xc005e34c -- > db_read_bytes() at db_read_bytes+0x1c > db_stack_trace_cmd() at db_stack_trace_cmd+0x1cc > db_print_backtrace() at db_print_backtrace+0x18 > backtrace() at backtrace+0x10 > witness_checkorder() at witness_checkorder+0x6b0 > [...] > fork_exit() at fork_exit+0x8c > fork_trampoline() at fork_trampoline+0x8 > ofw_pci_default_intr_pending() at ofw_pci_default_intr_pending+0x38 > panic: trap: fast data access mmu miss > at line 364 in file /var/portbuild/sparc64/src-client/sys/sparc64/sparc64/trap.ccpuid = 0; > Debugger("panic") > Stopped at Debugger+0x1c: ta %xcc, 1 > db> Looks like the back trace ran off the end of the stack; db_stack_trace_cmd() only handles the usual starting points of kernel stacks (traps from userland), but not freshly forked processes (or kernel threads). The attached patch should fix that by initializing the fr_pc and fr_fp fields of the first frame to 0 in cpu_fork(). - Thomas -- Thomas Moestl http://www.tu-bs.de/~y0015675/ http://people.FreeBSD.org/~tmm/ "In my opinion, television validates existence." -- Calvin and Hobbes --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="fork.diff" Index: sparc64/sparc64/vm_machdep.c =================================================================== RCS file: /vol/ncvs/src/sys/sparc64/sparc64/vm_machdep.c,v retrieving revision 1.58 diff -u -r1.58 vm_machdep.c --- sparc64/sparc64/vm_machdep.c 28 Dec 2003 08:57:09 -0000 1.58 +++ sparc64/sparc64/vm_machdep.c 1 Feb 2004 15:20:17 -0000 @@ -300,6 +300,8 @@ fp->fr_local[0] = (u_long)fork_return; fp->fr_local[1] = (u_long)td2; fp->fr_local[2] = (u_long)tf; + /* Terminate stack traces at this frame. */ + fp->fr_pc = fp->fr_fp = 0; pcb2->pcb_sp = (u_long)fp - SPOFF; pcb2->pcb_pc = (u_long)fork_trampoline - 8; --RnlQjJ0d97Da+TV1--