From owner-freebsd-current@FreeBSD.ORG Fri Feb 20 07:44:23 2004 Return-Path: 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 36A1E16A4CE for ; Fri, 20 Feb 2004 07:44:23 -0800 (PST) Received: from which.isds.duke.edu (which.isds.duke.edu [152.3.22.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1FE9643D2F for ; Fri, 20 Feb 2004 07:44:23 -0800 (PST) (envelope-from vangyzen@stat.duke.edu) Received: from sinatra.isds.duke.edu (sinatra.isds.duke.edu [152.3.22.120]) by which.isds.duke.edu (Postfix) with ESMTP id 78D23C38CC; Fri, 20 Feb 2004 10:44:22 -0500 (EST) From: Eric van Gyzen Organization: ISDS, Duke University To: Bruce Evans Date: Fri, 20 Feb 2004 10:44:22 -0500 User-Agent: KMail/1.5.4 References: <200402191542.54594.vangyzen@stat.duke.edu> <20040220171712.D4279@gamplex.bde.org> In-Reply-To: <20040220171712.D4279@gamplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402201044.22152.vangyzen@stat.duke.edu> cc: freebsd-current@freebsd.org Subject: Re: panic: arithmetic trap in fpurstor() in sys/i386/isa/npx.c X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Feb 2004 15:44:23 -0000 Bruce Evans wrote: > On Thu, 19 Feb 2004, Eric van Gyzen wrote: > > I can reliably panic 5.2-RELEASE GENERIC running on three different AMD > > Athlon CPUs with: > > > > # echo 'q()' | R --no-save > > > > R is ports/math/R-letter, and q() just tells R to quit. This does not > > happen on an AthlonMP or P3 running the same kernel. It did not happen > > on the same three Athlon machines while running 5.1-RELEASE. Some simple > > gdb debugging follows. If you need more info, please ask; I don't debug > > the kernel very often, so I'm not sure what to provide. :-/ > > Try backing out rev.1.216 of vm_machdep.c. I don't see exactly how this > commit could cause the problem, but it is the only related thing that has > changed since 5.1, and the first part of it has several bugs (it is a > layering violation and is missing explicit disabling of interrupts). I'll try that and reply later. (For now, I have to do my /real/ job...) > > panic: arithmetic trap > > ... > > (kgdb) list *0xc07e07b4 > > 0xc07e07b4 is in fpurstor (/usr/src/sys/i386/isa/npx.c:986). > > [snip] > > > > (kgdb) list 976,987 > > 976 static void > > 977 fpurstor(addr) > > 978 union savefpu *addr; > > 979 { > > 980 > > 981 #ifdef CPU_ENABLE_SSE > > 982 if (cpu_fxsr) > > 983 fxrstor(addr); > > 984 else > > 985 #endif > > 986 frstor(addr); > > 987 } > > frstror() can only cause an arithmetic trap on broken CPUs. I doubt > that Athlons are that broken, so this trap is mysterious. frstor() > doesn't even trap for plain i386's; it may cause a bogus IRQ13 which > the kernel has to be careful not to turn into an arithmetic trap. > > Please report the value and contents of addr (about 108 bytes of it > in hex). When I try to examine addr, gdb tells me 'No symbol "addr" in current context.' So, I switched to its caller and... #6 0xc07e05a1 in npxdna () at /build/src/sys/i386/isa/npx.c:840 840 fpurstor(&pcb->pcb_save); (kgdb) print &pcb->pcb_save $4 = (union savefpu *) 0x40 (kgdb) print pcb $5 = (struct pcb *) 0x0 Ummm...that doesn't look quite right. Please tell me if I'm missing something. Eric