Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WindowsPipes is not compatible with php 7.3 #28655

Closed
SailorMax opened this issue Oct 1, 2018 · 4 comments
Closed

WindowsPipes is not compatible with php 7.3 #28655

SailorMax opened this issue Oct 1, 2018 · 4 comments

Comments

@SailorMax
Copy link

Symfony/Process version(s) affected: 4.1.4

Description
PHP 7.3 allow unlink() 'locked' file at Pipes/WindowsPipes.php#L57 and return true.
In result if start 2 processes one by one, second process will delete file of previous one.
Possible this is error in PHP, but I can't create good bug report for PHP developers.

How to reproduce
I use fastest to use with phpunit in async mode. If run 2+ tests, first always return error.

Possible Solution
before for ($i = 0;; ++$i) { add

if (!isset($GLOBALS["sf_proc_i"]))
	$GLOBALS["sf_proc_i"] = 0;
else
	$GLOBALS["sf_proc_i"]++;
$i =& $GLOBALS["sf_proc_i"];
if ($i > 1024)
	$i = 0;

plus replace for ($i = 0;; ++$i) { on for (;; ++$i) {

Additional context
no

@nicolas-grekas
Copy link
Member

Can you please check if #28689 fixes your issue?

@nicolas-grekas
Copy link
Member

Oh, and tell us what the error is if not?

@SailorMax
Copy link
Author

No, this fix did not help. With it logic looks more correct (tries new $i for all pipes, not only for second, for example), but it did not fix the problem.
The real problem in first !unlink($file). In PHP 7.3 it successfully delete the file, which in use by first process, and start to use it for second process.

@fabpot fabpot closed this as completed Oct 10, 2018
fabpot added a commit that referenced this issue Oct 10, 2018
…ekas)

This PR was merged into the 2.8 branch.

Discussion
----------

[Process] fix locking of pipe files on Windows

| Q             | A
| ------------- | ---
| Branch?       | 2.8
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #28655
| License       | MIT
| Doc PR        | -

Commits
-------

d64bd3b [Process] fix locking of pipe files on Windows
@selcuk-karateke
Copy link

Can I uninstall this package?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants