php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19668 Crash when using callback with ob_start()
Submitted: 2002-09-30 03:09 UTC Modified: 2002-10-01 05:23 UTC
From: phpbugs at realplain dot com Assigned:
Status: Closed Package: Output Control
PHP Version: 4.2.3 OS: Win2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: phpbugs at realplain dot com
New email:
PHP Version: OS:

 

 [2002-09-30 03:09 UTC] phpbugs at realplain dot com
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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-30 09:43 UTC] sander@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip


 [2002-10-01 01:58 UTC] phpbugs at realplain dot com
Yes, that seems to have fixed it. However, on any larger, more complicated scripts (e.g. not the example I posted), including where I discovered the crash, Apache crashes if you refresh the page quickly. But I guess that's another issue in the dev build...
 [2002-10-01 02:25 UTC] sniper@php.net
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.


 [2002-10-01 02:50 UTC] phpbugs at realplain dot com
I have read that page but it doesn't apply to Windows, right? So is there anything I can do on Windows (I guess the "Dr. Watson" log file is useless)? Sorry. :-)
 [2002-10-01 05:23 UTC] yohgaki@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

This should be fixed in CVS.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 07:01:29 2024 UTC