php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73903 pg_socket : Bad file descriptor
Submitted: 2017-01-10 10:22 UTC Modified: 2021-08-22 04:22 UTC
Votes:2
Avg. Score:3.0 ± 2.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: amereii at rooyekhat dot co Assigned: cmb (profile)
Status: No Feedback Package: PostgreSQL related
PHP Version: 7.0.14 OS: CentOS release 6.8 (Final)
Private report: No CVE-ID: None
 [2017-01-10 10:22 UTC] amereii at rooyekhat dot co
Description:
------------
I want to add read event to pg_socket with event extension both don't accept resource of pg_socket but stream_select works well

For simplicity I write test script with well known library called reactphp/event-loop


if you run test script using event extension , this warning shown and there is no read event 

PHP Warning:  Event::add(): Epoll ADD(1) on fd 30584288 failed. Old events were 0; read change was 1 (add); write change was 0 (none); close change was 0 (none): Bad file descriptor in vendor/react/event-loop/src/ExtEventLoop.php on line 259
PHP Warning:  Event::add(): Failed adding event in vendor/react/event-loop/src/ExtEventLoop.php on line 259



Test script:
---------------
$loop = React\EventLoop\Factory::create();
$connection = pg_connect("host=localhost port=5432 dbname=mary");
$socket = pg_socket($connection);
$loop->addReadStream($socket , function (){
  echo "READ EVENT\n";
});

pg_send_query($connection , "select * from authors;");

Expected result:
----------------
PHP Warning:  Event::add(): Epoll ADD(1) on fd 30584288 failed. Old events were 0; read change was 1 (add); write change was 0 (none); close change was 0 (none): Bad file descriptor in vendor/react/event-loop/src/ExtEventLoop.php on line 259
PHP Warning:  Event::add(): Failed adding event in vendor/react/event-loop/src/ExtEventLoop.php on line 259



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-08-11 12:43 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-08-11 12:43 UTC] cmb@php.net
If this is still an issue with any of the actively supported PHP
versions[1] and the latest event package (3.0.5), please provide a
self contained reproduce script (not using any PHP libraries or
frameworks).

[1] <https://www.php.net/supported-versions.php>
 [2021-08-22 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Nov 24 02:01:28 2024 UTC