PHP 4.0 Bug #9323 Updated: SIGFPE immediately on startup, dso or cgi
| From: | derick@php.net | Date: | Sun, 18 Feb 2001 10:50:36 +0000 |
| Subject: | PHP 4.0 Bug #9323 Updated: SIGFPE immediately on startup, dso or cgi | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-46820@lists.php.net to get a copy of this message | ||
ID: 9323
Updated by: derick
Reported By: imdave@mcs.net
Old-Status: Open
Status: Closed
Bug Type: Reproduceable crash
Assigned To:
Comments:
Already fixed in CVS. You can use a snapshot from snaps.php.net or use the CVS version.
Previous Comments:
---------------------------------------------------------------------------
[2001-02-17 21:06:11] imdave@mcs.net
Built on an old release of FreeBSD (2.2.5).
I think that current releases might mask
most FPE exceptions by default, but I do
not know that for sure. I also think that
Linux masks all exceptions also, so the bug
is concealed on those systems. I tracked the
problem down to ext/standard/crypt.c, the line:
srand48((unsigned int) time(0) * getpid() * (php_combined_lcg() * 10000.0));
Sorry, I no longer have the buggy version built
so I can't get you a gdb backtrace. However, the
problem is simply that the double result is too
large to fit in a 32-bit integer and the SIGFPE
occurs. Note that even if one masks the exception,
there is still the problem that the result will then
become zero (see the intel x86 documentation) -- not
a very good thing to seed a random number generator
with.
As a quick fix, I just changed the line to:
srand48((unsigned int) time(0) * getpid());
since integer overflow doesn't cause an exception.
Note that this bug is probably related to #9106.
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=9323&edit=2