Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Oct 2002 00:40:11 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Peter Edwards <pmedwards@eircom.net>
Cc:        current@FreeBSD.ORG
Subject:   Re: Floating point problems
Message-ID:  <20021025002311.I295-100000@gamplex.bde.org>
In-Reply-To: <20021024115918.057A443E65@mx1.FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021025002311.I295-100000>