Closed
Description
Symfony version(s) affected: 4.2.8
Description
Symfony\Component\Process\Process::wait() function can leads to infinite loop in some cases.
How to reproduce
$process = new Process(['someScript.php']);
$process->setTimeout(1);
$process->start();
$process->signal(SIGSTOP);
$process->wait();
The infinite loop occur in while-cycle in 'wait' function:
while ($this->isRunning()) {
usleep(1000);
}
I've created a repo to easily reproduce this bug:
https://github.com/mshavliuk/SymfonyProcessIssue
It is enough to run showIssue.sh script to run some php code in docker, or, if you have some php environment you can just run php Issue.php
after install all packages (which is only symfony/process) and pcntl-ext.
Possible Solution
I will create a pull request with fixes, related with this bug. I hope I will find some solution to create simple and reliable unit-test to reproduce this bug, but It can be very difficult.