Current-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: should divide-by-zero generate a SIGFPE?
Oh, my cut&paste missed one important line. It also calls fpsetmask(3)
before trying to divide-by-zero:
{
double d = strtod("0", NULL);
...
sigaction(SIGFPE, &sa, NULL);
fpsetmask(FP_X_INV|FP_X_DZ|FP_X_OFL|FP_X_UFL|FP_X_IMP);
printf("%g\n", 1 / d);
...
On Fri, 24 Dec 2010, Paul Goyette wrote:
As some of you have noticed, I've been slowly migrating some of the old
src/regress tests to the new atf format. I've discovered that the test for
SIGFPE in src/regress/lib/libc/siginifo/sigfpe/ doesn't work. It attempts
trigger a signal by
{
double d = strtod("0", NULL);
...
sigaction(SIGFPE, &sa, NULL);
printf("%g\n", 1 / d);
...
But the routine specified in sa.sa_sigaction does not get called, and the
test fails.
So, is this expected behavior? I did a quick bug search and didn't find
anything relevant.
If this is expected, is there some other way to reliably generate a SIGFPE?
BTW, if it matters, I'm doing this on port-amd64.
-------------------------------------------------------------------------
| Paul Goyette | PGP Key fingerprint: | E-mail addresses: |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer | | pgoyette at netbsd.org |
-------------------------------------------------------------------------
-------------------------------------------------------------------------
| Paul Goyette | PGP Key fingerprint: | E-mail addresses: |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer | | pgoyette at netbsd.org |
-------------------------------------------------------------------------
Home |
Main Index |
Thread Index |
Old Index