SIGFPE, FreeBSD and some PHP math functions
| From: | Alexander Feldman | Date: | Sun, 11 Mar 2001 14:22:02 +0000 |
| Subject: | SIGFPE, FreeBSD and some PHP math functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-48648@lists.php.net to get a copy of this message | ||
Hello,
There is a bunch of mathematical functions that can generate core dump on
FreeBSD 3.4 (and on a whole group of other UNIX clones). Take for example
the following PHP script:
<?php
log(0);
?>
or
<?php
asin(2);
?>
and so on...
Obviously we should fix this behavior as there should not be a way for a
PHP script to crash the process. Here is the question how to do this. One
approach is to check for out of range value in the PHP functions before
calling the underlying math procedures. Another approach is to ignore the
signal (on FreeBSD that is SIGFPE) and manually in the appropriate PHP
functions to check if an exception flag is raised. Perhaps, there are
other decisions as well.
Are there any volunteers to write the code or I should take this?
-- Alex