Bug #70185 [Opn]: php-fpm restarts process forever when exec() and using ssh multiplexing

From: Date: Mon, 03 Aug 2015 03:21:06 +0000
Subject: Bug #70185 [Opn]: php-fpm restarts process forever when exec() and using ssh multiplexing
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-194921@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70185&edit=1 ID: 70185 User updated by: kobenews at cox dot net Reported by: kobenews at cox dot net Summary: php-fpm restarts process forever when exec() and using ssh multiplexing Status: Open Type: Bug Package: FPM related Operating System: CentOS release 6.6 (Final) PHP Version: 5.4.43 Block user comment: N Private report: N New Comment: Sorry, the script I provided is incorrect. I forgot a command at the end. It should be: <?php $command = 'ssh -o "ControlMaster=auto" -o "ControlPersist=2m" -S /home/justin/.ssh/sockets/justin.sock justin@1.2.3.4 uptime'; $output = exec($command, $output_array, $return_code); die($output); Previous Comments: ------------------------------------------------------------------------ [2015-08-03 02:54:44] kobenews at cox dot net Description: ------------ Ok bear with me, this bug is a bit obscure and takes some setup. However, it is consistent, and causes php-fpm to continue to restart the process over and over again using 100% of the CPU on the php-fpm master process. It only occurs with SSH controlMaster which basically allows SSH connection multiplexing. Here is an example code: <?php $command = 'ssh -o "ControlMaster=auto" -o "ControlPersist=2m" -S /home/justin/.ssh/sockets/justin.sock justin@1.2.3.4'; $output = exec($command, $output_array, $return_code); If you remove the options -o "ControlMaster=auto" -o "ControlPersist=2m" -S /home/justin/.ssh/sockets/justin.sock this works without crashing over and over again. Test script: --------------- <?php $command = 'ssh -o "ControlMaster=auto" -o "ControlPersist=2m" -S /home/justin/.ssh/sockets/justin.sock justin@1.2.3.4'; $output = exec($command, $output_array, $return_code); Expected result: ---------------- php-fpm master process should not restart the process over and over again. Nothing is crashing here. Actual result: -------------- php-fpm continues to restart the process over and over again using 100% of the CPU on the php-fpm master process. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=70185&edit=1

« previous php.bugs (#194921) next »