#40259 [Asn->Opn]: ob_start call many times - memory error

From: Date: Sun, 28 Jan 2007 08:15:39 +0000
Subject: #40259 [Asn->Opn]: ob_start call many times - memory error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-108146@lists.php.net to get a copy of this message
 ID:               40259
 Updated by:       mike@php.net
 Reported By:      tomwys at o2 dot pl
-Status:           Assigned
+Status:           Open
 Bug Type:         Output Control
 Operating System: Linux
 PHP Version:      5.2.0
 Assigned To:      mike
 New Comment:

It works even fine here with a count of 50000 if USE_ZEND_ALLOC=0 is
set. Maybe a MM failure?


Previous Comments:
------------------------------------------------------------------------

[2007-01-27 22:35:17] tony2001@php.net

Mike, this looks like a stack overflow to me (note that ob_flush() is
used, not ob_end_flush() so we got insane amount of nested buffers).
Do you think you can do something about it?

------------------------------------------------------------------------

[2007-01-27 22:13:21] tomwys at o2 dot pl

Description:
------------
I have tested this code on two machines. I have memory error  or
endless loop.

On first machine code fails from $count = 385 on second machine from
$count = 1633.

Reproduce code:
---------------
<?php
$count = 385;
for($i = 1; $i < $count; $i ++) {
  ob_start();
  echo $i;
  ob_flush(); 
} 

?>

Expected result:
----------------
123456789101112[etc.]

Actual result:
--------------
First machine:
1[there is endless loop and 100% CPU]

Second machine:
1*** glibc detected *** double free or corruption (top):
0x0000000004c9c370 ***
Aborted



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=40259&edit=1


Thread (8 messages)

« previous php.bugs (#108146) next »