[PHP-DEV] PHP 4.0 Bug #4297: segfault under Apache when using bad cleanup function From: vorlon <email protected>
Date: 05/02/00

From: vorlon <email protected>
Operating system: Linux 2.2, glibc 2.1.2, Apache 1.3.11
PHP version: 4.0 Latest CVS (02/05/2000)
PHP Bug Type: Reproduceable crash
Bug description: segfault under Apache when using bad cleanup function

Under PHP4, registering a shutdown function that contains invalid PHP code (such as a call to a non-existent function) causes the server process to segfault.
Here is a scriptlet which reproduces the problem:

<?
   function close_socket() {
      close($fd);
   }
   register_shutdown_function(close_socket);

?>

I stumbled on this quite accidentally--of course, I meant to use fclose() instead of close(). Still, it seems that PHP should handle this better than by causing a segfault. :)

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>