Bug #73903 [NEW]: pg_socket : Bad file descriptor
| From: | amereii at rooyekhat dot co | Date: | Tue, 10 Jan 2017 10:22:41 +0000 |
| Subject: | Bug #73903 [NEW]: pg_socket : Bad file descriptor | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-206455@lists.php.net to get a copy of this message | ||
From: amereii at rooyekhat dot co
Operating system: CentOS release 6.8 (Final)
PHP version: 7.0.14
Package: PostgreSQL related
Bug Type: Bug
Bug description:pg_socket : Bad file descriptor
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 bug report at https://bugs.php.net/bug.php?id=73903&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73903&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73903&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73903&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73903&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73903&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73903&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73903&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73903&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73903&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73903&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73903&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73903&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73903&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73903&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73903&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73903&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73903&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73903&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73903&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73903&r=mysqlcfg