Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Process] Infinite waiting for the dead process #31548

Copy link
Copy link
Closed
@mshavliuk

Description

@mshavliuk
Issue body actions

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.