Bug #22059
closedt3lib_div::cleanOutputBuffers() might loop forever
0%
Description
In particular environments it is possible that ob_get_level() doesn't get updated by ob_get_clean(). As both functions relay on the same data, it's also a redundant call which might fail.
I'ld propose to replace the whole while() loop starting around #5696 by
while(ob_end_clean());
As well as t3lib_div::flushOutputBuffers() didn't break things by now, I'ld propose to rewrite that while() loop also. This could read as:
while($obContent .= ob_get_clean());
I didn't check if Output Buffers are loosly handled at other places in the code, but I suggest to clean up every potential ob_* to NOT relay on ob_get_level().
This particular Error in t3lib_div::cleanOutputBuffers() can be verified by e.g. selecting different languages at the BE extension manager.
To reproduce it, run php with FPM SAPI via FCGI pipeline. This is one of the proposed SAPI for high-traffic, high-load sites.
We were able to reproduce it on different version of FPM-enabled PHP (5.2.n as well as 5.3.0/1)
(issue imported from #M13427)
Files
Updated by Alex Dangel almost 15 years ago
I can reproduce and verify this.
Every try to load Translation-Handling-page in Extension-Manager ends up in a "500 - Internal Server Error".
I fixed it first by uncomment the inital call of cleanOutputBuffers().
The Translation-Handling worked again, but showed the result after finishing all instead of display step by step while in progress.
I tried the Patch from Stephan and all is working the right way again.
THX for that elegant Bugfix.
@core-developers: please get this in the sources for the next release.
kind regards
Alex
Updated by Jacob Rasmussen over 14 years ago
I too can confirm this bug on 4.3.2 - although i'm using PHP as an ISAPI module
The bugfix works as it should
Best regards
Jacob
Updated by Daniel Krupke over 14 years ago
The problem seems to be solved by your patch/fix.
So, why don't you write an RFC on the Core Developer Mailing List?
Updated by Steffen Gebert over 14 years ago
The patch is now pending in the core list. Please test and vote immediately (you can give your okay by answering "+1 by testing", after you did test the code and "by reading" after you read the code).
Please hurry up, if you want this in the next releases of TYPO3!
Updated by Trandel Miszcz over 14 years ago
The patch helped me for various versions of TYPO3 including 4.4.0. My vote +1.
Updated by Steffen Gebert over 14 years ago
You have to give your vote on the core team mailing list, otherwise it doesn't count.
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-team-core
(but better use a news reader news://lists.typo3.org)