#32838 [Opn]: child processes opened with proc_open freeze the script

From: Date: Tue, 26 Apr 2005 13:21:03 +0000
Subject: #32838 [Opn]: child processes opened with proc_open freeze the script
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-78226@lists.php.net to get a copy of this message
ID: 32838 User updated by: mjpph at stardust dot fi Reported By: mjpph at stardust dot fi Status: Open Bug Type: Program Execution Operating System: Linux PHP Version: 5.0.4 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#78226) next »