Bug #73903 [Opn->Fbk]: pg_socket : Bad file descriptor

From: Date: Wed, 11 Aug 2021 12:43:20 +0000
Subject: Bug #73903 [Opn->Fbk]: pg_socket : Bad file descriptor
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235764@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73903&edit=1 ID: 73903 Updated by: cmb@php.net Reported by: amereii at rooyekhat dot co Summary: pg_socket : Bad file descriptor -Status: Open +Status: Feedback Type: Bug Package: PostgreSQL related Operating System: CentOS release 6.8 (Final) PHP Version: 7.0.14 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: 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> Previous Comments: ------------------------------------------------------------------------ [2021-08-11 12:36:29] cmb@php.net Related To: Bug #73941 ------------------------------------------------------------------------ [2017-01-10 10:22:37] 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 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73903&edit=1

« previous php.bugs (#235764) next »