Bug #32574
FLOW3 enters fork bombs when using cgi-fcgi vs cli
Status: | Accepted | Start date: | 2011-12-14 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | Karsten Dambekalns | % Done: | 0% |
|
Category: | Core | |||
Target version: | - | |||
PHP Version: | 5.3 | Complexity: | ||
Has patch: | No | Affected Flow version: | Git master |
Description
How I discovered the bug.¶
I installed FLOW3 (and Typo3 Phoenix) via git yesterday on my shared host. Everything worked fine on CLI including flow3:core:compile. But when I would hit the site via my browser, FLOW3 entered an endless loop of forking new processes (fork bomb) until the ulimit max number of processes (100) is reached, when it gave this error:
#1: Warning: system() [<a href='function.system'>function.system</a>]: Unable to fork [XDEBUG_CONFIG="idekey=FLOW3_SUBREQUEST" FLOW3_ROOTPATH='/home/cognifir/public_domains/TYPO3v5/' FLOW3_CONTEXT='Development' "/usr/bin/php" -c '/home/cognifir/.php/php.ini' '/home/cognifir/public_domains/TYPO3v5/Packages/Framework/TYPO3.FLOW3/Classes/Core/../../Scripts/flow3.php' 'typo3.flow3:core:compile'] in /home/cognifir/public_domains/TYPO3v5/Packages/Framework/TYPO3.FLOW3/Classes/Core/Booting/Scripts.php line 423
Occassionally I'd also get this error in the php5 error log:
[14-Dec-2011 13:14:22] PHP Fatal error: Out of memory (allocated 54263808) (tried to allocate 7680 bytes) in /home/cognifir/public_domains/TYPO3v5/Data/Temporary/Development/Cache/Code/Fluid_TemplateCache/typo3_template_fb28020226817cc1696e7cec37ba5786d3434e0e.php on line 65
However neither of these error messages are particularly helpful, they only point at two symptoms (1) running out of available processes (2) running out of available memory.
By running the command FLOW3 was trying to run I get the following Result:
$ XDEBUG_CONFIG="idekey=FLOW3_SUBREQUEST" FLOW3_ROOTPATH='/home/cognifir/public_domains/TYPO3v5/' FLOW3_CONTEXT='Development' "/usr/bin/php" -c '/home/cognifir/.php/php.ini' '/home/cognifir/public_domains/TYPO3v5/Packages/Framework/TYPO3.FLOW3/Classes/Core/../../Scripts/flow3.php' 'typo3.flow3:core:compile' X-Powered-By: PHP/5.3.8 Content-type: text/html The FLOW3 command line script or sub process was executed with a 'cgi-fcgi' PHP binary. Make sure that you specified a CLI capable PHP binary in your PATH or FLOW3's Settings.yaml.
Resolution¶
To resolve this, I uncommented (as I wasn't using it before) and set phpBinaryPathAndFilename: '/user/local/bin/php'
in Settings.yaml.
Next steps¶
- I think it would be great to catch this error and exit with a useful exception/error message instead of entering the endless loop of spawning new flow3 processes over and over.
- Also, a note in the manual about using phpBinaryPathAndFilename to point to the CLI php would be helpful. Also, this suggests that it is not just for Windows like the example Settings.yaml indicates.
Related issues
History
#1 Updated by Karsten Dambekalns over 3 years ago
- Category set to Core
- Status changed from New to Accepted
- Assigned To set to Karsten Dambekalns