PHP 4.0 Bug #4297: segfault under Apache when using bad cleanup function
| From: | vorlon at netexpress dot net | Date: | Tue, 02 May 2000 17:37:12 +0000 |
| Subject: | PHP 4.0 Bug #4297: segfault under Apache when using bad cleanup function | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-18359@lists.php.net to get a copy of this message | ||
From: vorlon@netexpress.net
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. :)