Bug #17193 Updated: calling getenv after register_shutdown causes apache to crash
| From: | derick@php.net | Date: | Tue, 14 May 2002 05:19:08 +0000 |
| Subject: | Bug #17193 Updated: calling getenv after register_shutdown causes apache to crash | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-7596@lists.php.net to get a copy of this message | ||
ID: 17193
Updated by: derick@php.net
Reported By: jtate@php.net
-Status: Open
+Status: Feedback
Bug Type: Scripting Engine problem
Operating System: RH Linux 7.2/Apach 1.3.22
PHP Version: 4.1.2
New Comment:
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php
Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
You can find ho wto make a backtrace on the location mentioned above.
Derick
Previous Comments:
------------------------------------------------------------------------
[2002-05-13 19:25:57] jtate@php.net
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 this bug report at http://bugs.php.net/?id=17193&edit=1