From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 10755 invoked from network); 7 Jan 1999 10:39:38 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 7 Jan 1999 10:39:38 -0000 Received: from bragg.art.co.uk (gatekeeper.art-render.com [193.131.113.125]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id FAA28909 for ; Thu, 7 Jan 1999 05:20:08 -0500 Received: from art.co.uk (zehnder.art.co.uk [192.168.1.76]) by bragg.art.co.uk (8.8.5/8.8.5) with ESMTP id KAA20201; Thu, 7 Jan 1999 10:19:32 GMT Sender: jrc@art.co.uk Message-ID: <36948A47.5DA8374@art.co.uk> Date: Thu, 07 Jan 1999 10:19:51 +0000 From: John Connett Organization: Advanced Rendering Technology X-Mailer: Mozilla 4.05C-SGI [en] (X11; I; IRIX 6.3 IP32) MIME-Version: 1.0 To: axp-list@redhat.com Subject: Re: Problem with floating point exceptions References: <199901062323.QAA27622@ellpspace.math.ualberta.ca> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Michal Jaegermann wrote: > > Greg Lindahl wrote: > > > > > I get floating > > > point exceptions in sections of the code which evaluate exp(-x) for large > > > positive values of x. > > > > FAQ. You need to use the -mieee flag in order to use denormalized > > numbers at all. > .... > > > > Note that -mieee will slow down your code by a factor of 2 or more. > > If you have only underflows and you want them silently converted > to zero you may install your private "do-nothing" signal handler > for FPE. Note that this act the same way for **all** floating point > exceptions and this may be not what you really want. > > Michal Another couple of things to be aware of: 1) Even if you install a "do-nothing" signal handler the kernel will still do quite a bit of work when a SIGFPE occurs. In the Red Hat version of 2.0.36 that includes a printk which writes a message to the console. Running a simple program which has a tight loop generating SIGFPEs is an easy way to make a denial of service attack! I have commented out the offending message from my kernel builds. My opinion is that a detectable error in a user process should definitely not generate a console message. 2) Should you be tempted to try to block SIGFPEs using sigprocmask(SIG_BLOCK, ...) you will find that it doesn't work. All SIGFPEs are forced to raise the signal. I outlined a fix in a message sent to this list on 12 Nov 1998 and asked for comments (I didn't receive any). I haven't looked at the 2.2.0pre? sources yet to see if these problems are still present. -- John Connett (jrc@art.co.uk)