From owner-freebsd-hackers Thu Dec 23 14: 9: 2 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from oracle.dsuper.net (oracle.dsuper.net [205.205.255.1]) by hub.freebsd.org (Postfix) with ESMTP id 615A214CFD for ; Thu, 23 Dec 1999 14:08:56 -0800 (PST) (envelope-from bmilekic@dsuper.net) Received: from oracle.dsuper.net (oracle.dsuper.net [205.205.255.1]) by oracle.dsuper.net (8.9.3/8.9.3) with ESMTP id RAA04748; Thu, 23 Dec 1999 17:08:45 -0500 (EST) Date: Thu, 23 Dec 1999 17:08:45 -0500 (EST) From: Bosko Milekic To: Sheldon Hearn Cc: hackers@FreeBSD.ORG Subject: Re: SIGFPE on arithmetic overflow In-Reply-To: <59472.945979754@axl.noc.iafrica.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 23 Dec 1999, Sheldon Hearn wrote: !> !> !>On Thu, 23 Dec 1999 22:05:15 +0200, Sheldon Hearn wrote: !> !>> It still bombs, although fpsetmask(0) does the trick. I'm really !>> interested in hearing what causes the difference in behaviour. !> !>It seems that the exception is happening on FP_X_INV, which is odd for !>what seems to be an under/overflow. !> !>Ciao, !>Sheldon. !> Here's a shot in the dark, although somebody else could probably offer a somewhat better explanation. From npx.c: * The 6 maskable bits in order of their preference, as stated in the * above referenced Intel manual: * 1 Invalid operation (FP_X_INV) * 1a Stack underflow * 1b Stack overflow * 1c Operand of unsupported format * 1d SNaN operand. * 2 QNaN operand (not an exception, irrelavant here) * 3 Any other invalid-operation not mentioned above or zero divide * (FP_X_INV, FP_X_DZ) * 4 Denormal operand (FP_X_DNML) * 5 Numeric over/underflow (FP_X_OFL, FP_X_UFL) * 6 Inexact result (FP_X_IMP) My guess would be that what is actually caught here is a stack over/underflow and because FP_X_INV (which covers this possibility) is not unmasked; the trap occurs and the signal is posted. Could somebody try this piece of code on a -STABLE machine, just out of curiosity...? Bosko. ...... . . . . . . . . . . . . . Bosko Milekic -- bmilekic@dsuper.net . . . . . . . . . . . ...... . . WWW: http://pages.infinit.net/bmilekic/ . ................................................ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message