From owner-freebsd-current Thu Oct 24 7:29:14 2002 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 53E7837B401 for ; Thu, 24 Oct 2002 07:29:13 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id F09D043E42 for ; Thu, 24 Oct 2002 07:29:11 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id AAA17583; Fri, 25 Oct 2002 00:29:05 +1000 Date: Fri, 25 Oct 2002 00:40:11 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Peter Edwards Cc: current@FreeBSD.ORG Subject: Re: Floating point problems In-Reply-To: <20021024115918.057A443E65@mx1.FreeBSD.org> Message-ID: <20021025002311.I295-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Thu, 24 Oct 2002, Peter Edwards wrote: > There was some discussion about issues with interactions between the floating > point context and signal handling in a thread a week or so ago, and a suggestion > that someone try and get a simple test that would fail. I was surprised how > easy it was: The following program just spins calculating the value of 6.0 / > 3.0, and traps SIGINT. > > If you run it on -current (as of a few hours ago), 99% of the time, hitting > ctl-C will cause the program to exit with an error. A 4.5 kernel never causes > any problems. > > I'm pretty sure this is what's causing the stalls and crashes in X. I've taken > stack traces of crashes, and from "spinning" processes, and I can spot NaNs on > the stack that shouldn't be there, etc. Thanks. This makes the main bug clear. The PCB_NPXINITDONE bit in the state was not being restored. This was confusing to debug because gdb doesn't understand this bug so it shows the state that should have been restored until npxdna() unrestores it consistently. Try this fix. %%% Index: npx.c =================================================================== RCS file: /home/ncvs/src/sys/i386/isa/npx.c,v retrieving revision 1.133 diff -u -2 -r1.133 npx.c --- npx.c 20 Oct 2002 17:30:30 -0000 1.133 +++ npx.c 24 Oct 2002 14:20:33 -0000 @@ -1004,4 +1007,5 @@ bcopy(addr, &td->td_pcb->pcb_save, sizeof(*addr)); } + curthread->td_pcb->pcb_flags |= PCB_NPXINITDONE; } %%% Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message