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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: nikic@php.net
New email:
PHP Version: OS:

 

 [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: Tue Mar 19 09:01:30 2024 UTC