Bug #78883 [PATCH]: fgets(STDIN) fails on Windows
| From: | cmb@php.net | Date: | Fri, 29 Nov 2019 12:18:04 +0000 |
| Subject: | Bug #78883 [PATCH]: fgets(STDIN) fails on Windows | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-223940@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78883&edit=1
ID: 78883
Patch added by: cmb@php.net
Reported by: php at nztm dot net
Summary: fgets(STDIN) fails on Windows
Status: Verified
Type: Bug
Package: Streams related
Operating System: Windows 10 x64
PHP Version: 7.4.0
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
The following pull request has been associated:
Patch Name: Fix #78883: fgets(STDIN) fails on Windows
On GitHub: https://github.com/php/php-src/pull/4952
Patch: https://github.com/php/php-src/pull/4952.patch
Previous Comments:
------------------------------------------------------------------------
[2019-11-29 12:08:03] cmb@php.net
The behavioral change has been introduced with commit d05deaa[1],
which has been squashed in to the commit mentioned above. That
change is necessary to avoid that ftell() gets called on character
files, which would render the return value to be undefined[2].
What has been missed in this commit, is to properly adjust
self->is_pipe_blocking (which is a Windows only flag), to avoid
calling PeekNamedPipe() on characters files, which is not
supported[3].
[1] <https://github.com/php/php-src/pull/4684/commits/d05deaad69dfc1e578bd690923cb573c2e6583c9>
[2] <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/ftell-ftelli64?view=vs-2019#return-value>
[3] <https://docs.microsoft.com/en-us/windows/win32/api/namedpipeapi/nf-namedpipeapi-peeknamedpipe#parameters>
------------------------------------------------------------------------
[2019-11-29 08:49:40] julien dot boudry at gmail dot com
Ok, In fact, I have tested under higer level code, so probably you are right. ( https://github.com/symfony/symfony/issues/34702
. This one, I'm sur 100% it's RC5 on two differents Windows 10 up to date installation.
I will try to switch on RC4 and tell you if it's working. If I not answer, consider that you
are right.
------------------------------------------------------------------------
[2019-11-29 08:34:12] cmb@php.net
> This happens since 7.4 RC5, working well on RC4 !
For me, it fails with RC4 as well. Apparently, the issue has been
caused by commit 9ec61e4[1], which is shipped as of 7.4.0RC2.
[1] <http://git.php.net/?p=php-src.git;a=commit;h=9ec61e43d453aadab9539f6814e8694295aa1ed1>
------------------------------------------------------------------------
[2019-11-29 07:53:35] julien dot boudry at gmail dot com
Hi,
This happens since 7.4 RC5, working well on RC4 !
------------------------------------------------------------------------
[2019-11-28 23:10:31] cmb@php.net
Thanks for reporting!
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=78883
--
Edit this bug report at https://bugs.php.net/bug.php?id=78883&edit=1