From: [EMAIL PROTECTED]
Operating system: RH Linux 7.2/Apach 1.3.22
PHP version: 4.1.2
PHP Bug Type: Scripting Engine problem
Bug description: calling getenv after register_shutdown causes apache to crash
If you call register_shutdown_function, and then in the registered function
make a call to getenv, Apache segfaults.
Here's a sample script:
<?PHP
function shutdowner()
{
$out = fopen("/tmp/env.out", "at");
fwrite($out, "getenv returned " . getenv("HOME") . "\n");
fclose($out);
}
echo "Getenv returned " . getenv("HOME") . "\n";
register_shutdown_function("shutdowner");
?>
Please note. This only happens when running as an apache module. CLI
works fine, and I'd assume that CGI does too.
I'll post a back trace if some kind soul will explain how to do it under
RH linux using the messed up !apachectl method that they use to start
apache.
--
Edit bug report at http://bugs.php.net/?id=17193&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=17193&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=17193&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=17193&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=17193&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=17193&r=support
Expected behavior: http://bugs.php.net/fix.php?id=17193&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=17193&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=17193&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=17193&r=globals