Re: SIGFPE, FreeBSD and some PHP math functions
| From: | Andi Gutmans | Date: | Sun, 11 Mar 2001 20:42:28 +0000 |
| Subject: | Re: SIGFPE, FreeBSD and some PHP math functions | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-48660@lists.php.net to get a copy of this message | ||
Did you see the #ifdef __FreeBSD__ in zend.c?
It prevents the SIGFPE if I remember correctly, when we lose precision on FreeBSD. Maybe this mask can also fix the problems you have of not crashing.
I can't check out the man page right now beause I don't have access to FreeBSD but it might be doable and would prevent us from searching through all of the source code.
Andi
At 04:22 PM 3/11/2001 +0200, Alexander Feldman wrote:
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: <?phplog(0);?> or <?phpasin(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 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net