php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79564 poll() cannot be interrupted
Submitted: 2020-05-04 07:58 UTC Modified: -
From: nikic@php.net Assigned:
Status: Open Package: Streams related
PHP Version: master-Git-2020-05-04 (Git) OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
9 + 14 = ?
Subscribe to this entry?

 
 [2020-05-04 07:58 UTC] nikic@php.net
Description:
------------
https://github.com/php/php-src/blob/342754575237da912874f781a24eefe76434ce5a/main/streams/xp_socket.c#L144 performs an unlimited loop on EINTR during polling. This means that it's not possible to interrupt the process using Ctrl+C.

To reproduce, run php -S localhost:8000 on

if (!empty($_GET['self'])) {
    echo 'content';
} else {
    echo file_get_contents('http://localhost:8000?self=1');
}

try to access http://localhost:8000/ and then try to exit the built-in server.


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-05-26 20:47 UTC] nikic@php.net
The following pull request has been associated:

Patch Name: Don't continue polling on EINTR
On GitHub:  https://github.com/php/php-src/pull/5521
Patch:      https://github.com/php/php-src/pull/5521.patch
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 03:01:29 2024 UTC