From:             [EMAIL PROTECTED]
Operating system: Win2000
PHP version:      4.2.3
PHP Bug Type:     Output Control
Bug description:  Crash when using callback with ob_start()

System: Win2000 SP3 (dual CPU if it matters), Apache 1.3.26 (default
setup), and PHP 4.2.3 as a module (default setup)

Problem: When I use ob_start('callback') and "callback" takes $var as its
parameter, Apache crashes if you modify $var and reassign it to $var.

Code:
<?php

ob_start('test');

echo 'This is a test!';

function test($output)
{
        $output = strtoupper($output);
        return $output;

        // Use this instead of the above and it works
        $test = strtoupper($output);
        return $test;
}

?>


It seems that an Apache child thread can process the script once before it
crashes the child process. e.g. Refresh within KeepAliveTimeout seconds
and it will crash; or with KeepAlive Off, it crashes after ThreadsPerChild
requests.

The "Apache.exe has generated errors..." box pops up. The only thing in
Apache's error log is

[info] master_main: Child processed exited prematurely. Restarting the
child process.

I have the "Dr. Watson" crash log file that was generated if it's of any
use: http://www.realplain.com/phpcrash.txt

BTW, that's weird; I just closed some apps that I usually have running so
their processes wouldn't show up in that log and now I can't get the above
script to crash every time (or at all!) like I could a few mins ago.
Hmm... So don't know if you can reproduce it. However, the script where I
originally noticed it is still crashing consistently as before.


Thanks for your time.
-- 
Edit bug report at http://bugs.php.net/?id=19668&edit=1
-- 
Try a CVS snapshot:  http://bugs.php.net/fix.php?id=19668&r=trysnapshot
Fixed in CVS:        http://bugs.php.net/fix.php?id=19668&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=19668&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=19668&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=19668&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19668&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=19668&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=19668&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=19668&r=submittedtwice
register_globals:    http://bugs.php.net/fix.php?id=19668&r=globals

Reply via email to