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

PTY mode: Input/output error #34945

Closed
cheack opened this issue Dec 12, 2019 · 3 comments
Closed

PTY mode: Input/output error #34945

cheack opened this issue Dec 12, 2019 · 3 comments

Comments

@cheack
Copy link

cheack commented Dec 12, 2019

Symfony version(s) affected: v4.4.1

Description
When I set PTY mode for process, I get the following error:

fread(): read of 8192 bytes failed with errno=5 Input/output error

OS: official ubuntu:18.04 docker image.
PHP: 7.4.0 from ondrej/php PPA:

PHP 7.4.0 (cli) (built: Nov 28 2019 07:27:06) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.0, Copyright (c), by Zend Technologies
    with Xdebug v2.8.1, Copyright (c) 2002-2019, by Derick Rethans

How to reproduce
Here is a minimal example:

$process = new Process(['echo', '123']);
$process->setPty(true);
$process->run();
@mbardelmeijer
Copy link
Contributor

Able to reproduce this as well on PHP 7.4. Execution of the process is still successful, but the notice is outputted.

Perhaps these need to be suppressed from 7.4?

https://www.php.net/manual/en/migration74.incompatible.php#migration74.incompatible.core.fread-fwrite

fread() and fwrite() will now return FALSE if the operation failed. Previously an empty string or 0 was returned. EAGAIN/EWOULDBLOCK are not considered failures.
These functions now also raise a notice on failure, such as when trying to write to a read-only file resource.

@Alig96
Copy link

Alig96 commented Jan 31, 2020

Also encountering this issue on 7.4 :(

@gedimin45
Copy link

Just upgraded to PHP 7.4 and started encountering when \Symfony\Component\Console\Application::renderThrowable is invoked. symfony/console version 4.4.4.

nicolas-grekas added a commit that referenced this issue Apr 10, 2020
This PR was merged into the 4.4 branch.

Discussion
----------

[Process] Fixed input/output error on PHP 7.4

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34945
| License       | MIT
| Doc PR        |

This PR aims to fix the error from #34945, but i'm unsure if this is the best solution. The issue is that on PHP 7.4 the input/output error may come up.

php.net/manual/en/migration74.incompatible.php#migration74.incompatible.core.fread-fwrite

> fread() and fwrite() will now return FALSE if the operation failed. Previously an empty string or 0 was returned. EAGAIN/EWOULDBLOCK are not considered failures. These functions now also raise a notice on failure, such as when trying to write to a read only file resource.

Commits
-------

b98abde Supress error from fread when reading a unix pipe
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

7 participants