Page MenuHomePhabricator

D20083.id47952.diff
No OneTemporary

D20083.id47952.diff

diff --git a/src/utils/utils.php b/src/utils/utils.php
--- a/src/utils/utils.php
+++ b/src/utils/utils.php
@@ -1014,7 +1014,19 @@
$write = array($stream);
$except = array();
- @stream_select($read, $write, $except, 0);
+ $result = @stream_select($read, $write, $except, 0);
+ if ($result === false) {
+ // See T13243. If the select is interrupted by a signal, it may return
+ // "false" indicating an underlying EINTR condition. In this case, the
+ // results (notably, "$write") are not usable because "stream_select()"
+ // didn't update them.
+
+ // In this case, treat this stream as blocked and tell the caller to
+ // retry, since EINTR is the only condition we're currently aware of that
+ // can cause "fread()" to return "0" and "stream_select()" to return
+ // "false" on the same stream.
+ return 0;
+ }
if (!$write) {
// The stream isn't writable, so we conclude that it probably really is

File Metadata

Mime Type
text/plain
Expires
Thu, Apr 10, 6:23 PM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7718343
Default Alt Text
D20083.id47952.diff (952 B)

Event Timeline