Skip to content

UvDriver cannot scan empty dir #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
robberphex opened this issue Jan 22, 2018 · 4 comments
Closed

UvDriver cannot scan empty dir #23

robberphex opened this issue Jan 22, 2018 · 4 comments

Comments

@robberphex
Copy link

For this code:

<?php
require __DIR__ . '/vendor/autoload.php';

use Amp\File;
use Amp\Loop;
use App\App;

Loop::run(function () {
    $flist = yield File\scandir("/tmp/tmp/");
    var_dump($flist);
});

/tmp/tmp is empty dir


Run php72 -dmemory_limit=1024m /path/to/php.php, it throw a excepiton:

PHP Fatal error:  Uncaught Amp\File\FilesystemException: Failed reading contents from /tmp/tmp/ in /opt/pkgist/vendor/amphp/file/lib/UvDriver.php:420
Stack trace:
#0 [internal function]: Amp\File\UvDriver->Amp\File\{closure}(NULL, 0)
#1 /opt/pkgist/vendor/amphp/amp/lib/Loop/UvDriver.php(174): uv_run(Object(UVLoop), 1)
#2 /opt/pkgist/vendor/amphp/amp/lib/Loop/Driver.php(130): Amp\Loop\UvDriver->dispatch(true)
#3 /opt/pkgist/vendor/amphp/amp/lib/Loop/Driver.php(70): Amp\Loop\Driver->tick()
#4 /opt/pkgist/vendor/amphp/amp/lib/Loop.php(76): Amp\Loop\Driver->run()
#5 /opt/pkgist/bin/gc2(11): Amp\Loop::run(Object(Closure))
#6 {main}
  thrown in /opt/pkgist/vendor/amphp/file/lib/UvDriver.php on line 420

But run env AMP_LOOP_DRIVER='\Amp\Loop\EvDriver' php72 -dmemory_limit=1024m /path/to/php.php, it works normally:

array(0) {
}
@kelunik
Copy link
Member

kelunik commented Jan 22, 2018

Which version of libuv do you have? I've found this in the changelog.

@kelunik kelunik added the bug label Jan 22, 2018
@robberphex
Copy link
Author

php72-php-fpm-7.2.1-1.el7.remi.x86_64
php72-php-pecl-uv-0.2.2-2.el7.remi.x86_64
libuv-1.10.2-1.el7.x86_64

@trowski
Copy link
Member

trowski commented Oct 27, 2018

I think @bwoebi needs to update php-uv to support libuv 1.0. In the mean time I committed a work-around in 04f047a.

@trowski trowski closed this as completed Oct 27, 2018
@bwoebi
Copy link
Member

bwoebi commented Nov 2, 2018

Thanks @trowski, fixed it upstream: amphp/ext-uv@72aa710

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants