Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002091 [Quercus] major always 10-18-07 23:56 10-19-07 13:53
Reporter koreth View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 3.1.3
Summary 0002091: Output buffering goes into infinite loop if output exceeds a certain size
Description <?php
function stash_it($text) {
  global $output;
  $output = $text;
}
ob_start('stash_it');
for ($i = 0; $i < 10000; $i++) {
  print " - $i";
}
ob_end_flush();
print $output;

Vanilla PHP prints the numbers 0 to 9999. Quercus gets caught in an infinite loop calling ob_end_flush -- it looks like a link list entry manages to point to itself as the next item. (OutputBuffer.getContents()).

If you reduce the maximum number to, say, 1000, this works fine under Quercus.
Additional Information
Attached Files

- Relationships

- Notes
(0002370)
koreth
10-19-07 10:21

Adding "return null;" to the end of the callback function clears this problem up, so this may be a difference in default return value semantics in Quercus vs. PHP rather than an output buffering issue per se (but the test case as posted does act differently in the two environments and does make Quercus go into an infinite loop.)
 
(0002371)
ferg
10-19-07 13:53

php/1l1-
 

- Issue History
Date Modified Username Field Change
10-18-07 23:56 koreth New Issue
10-19-07 10:21 koreth Note Added: 0002370
10-19-07 13:53 ferg Note Added: 0002371
10-19-07 13:53 ferg Assigned To  => ferg
10-19-07 13:53 ferg Status new => closed
10-19-07 13:53 ferg Resolution open => fixed
10-19-07 13:53 ferg Fixed in Version  => 3.1.4


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
31 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker