ID: 32838 Updated by: [EMAIL PROTECTED] Reported By: mjpph at stardust dot fi Status: Feedback Bug Type: Program Execution Operating System: Linux PHP Version: 5.0.4 New Comment:
Also specify which SAPI you are using: eg: Apache, CLI, CGI. Note that launching a CGI child process from either Apache or an existing CGI process is going to bite you unless you clean up the environmental variables you pass on to the child process. Previous Comments: ------------------------------------------------------------------------ [2005-04-27 12:42:22] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If possible, make the script source available online and provide an URL to it here. Try to avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [2005-04-26 15:21:02] mjpph at stardust dot fi It also seems that by using only on fgets() per select to get the child process's output seems to make the script a lot more stable than for example getting the whole buffer with stream_get_contents or by loopin fgets/stream_get_line. This was also the case with the earlier script though it didn't make the script still completely stable. ------------------------------------------------------------------------ [2005-04-26 14:31:21] mjpph at stardust dot fi Description: ------------ I've created three scripts during some time, which of the latest is under PHP 5.0.4. It opens hlds or srcds process as a child process using proc_open. Every pipe is made non-blocking also there are no infinite loops except the one that selects the child process's stdout pipe. The script reads and runs succesfully for some time, then it suddenly freezes. All buffering is turned off that can be turned off, I also added some DEBUG printouts in the code and it even once freezed in the middle of a single print. The same thing happens with pty and pipe support. Everything has been checked out dozens of times. Both the child process's stdout and stderr pipes are selected and read constantly. If the child process is terminated from a shell with a kill command the php script suddenly exits without any error or warning message even though it should keep looping the child process, which it normally does if it doesn't freeze. This behaviour is only happening with hlds and srcds child processes. I've run thousands of execution times of hltv's witht the same script and it has never freezed. Srcds and hlds processes output a lot more data though. The child process actually continues to run without any problems even if the proc_open is done without pipes and the script has frozen. Obviously the php script as a control script becomes completely useless after this. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32838&edit=1