Bug #79000 [NEW]: Non-blocking socket stream reports EAGAIN as error
| From: | nikic@php.net | Date: | Thu, 19 Dec 2019 12:20:01 +0000 |
| Subject: | Bug #79000 [NEW]: Non-blocking socket stream reports EAGAIN as error | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-224411@lists.php.net to get a copy of this message | ||
From: nikic
Operating system:
PHP version: 7.4Git-2019-12-19 (Git)
Package: Streams related
Bug Type: Bug
Bug description:Non-blocking socket stream reports EAGAIN as error
Description:
------------
EAGAIN/EWOULDBLOCK writes result in a notice for non-blocking socket
streams. Since PHP 7.4 additionally false will be returned.
Test script:
---------------
<?php error_reporting(E_ALL);
[$sock1, $sock2] = stream_socket_pair(STREAM_PF_UNIX,
STREAM_SOCK_STREAM, STREAM_IPPROTO_IP);
$str = str_repeat('a', 1000000);
stream_set_blocking($sock1, false);
var_dump(fwrite($sock1, $str));
var_dump(fwrite($sock1, $str));
Expected result:
----------------
int(196608)
int(0)
Actual result:
--------------
Notice: fwrite(): send of 8192 bytes failed with errno=11 Resource
temporarily unavailable in /home/nikic/php-7.4/t246.php on line 6
int(196608)
Notice: fwrite(): send of 8192 bytes failed with errno=11 Resource
temporarily unavailable in /home/nikic/php-7.4/t246.php on line 7
bool(false)
--
Edit bug report at https://bugs.php.net/bug.php?id=79000&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79000&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79000&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79000&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79000&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79000&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79000&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79000&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79000&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79000&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79000&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79000&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79000&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79000&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79000&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79000&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79000&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79000&r=mysqlcfg