From: John Connett <jrc@art.co.uk>
To: axp-list@redhat.com
Subject: Re: Problem with floating point exceptions
Date: Thu, 07 Jan 1999 10:19:51 +0000 [thread overview]
Message-ID: <36948A47.5DA8374@art.co.uk> (raw)
In-Reply-To: 199901062323.QAA27622@ellpspace.math.ualberta.ca
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)
next prev parent reply other threads:[~1999-01-07 10:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-01-06 21:29 Problem with floating point exceptions John Montgomery
1999-01-06 21:47 ` Greg Lindahl
1999-01-06 23:23 ` Michal Jaegermann
1999-01-07 10:19 ` John Connett [this message]
1999-01-06 21:57 ` Adam C. Powell, IV
1999-01-07 1:06 ` Joachim Wesner
1999-01-07 15:54 ` Samba Izaak Bozof
1999-01-07 16:53 ` Samba feedback
1999-01-07 16:56 ` Samba Michal Jaegermann
1999-01-07 17:57 ` Samba Maurice Hilarius
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox