[php-maint] Bug#426096: glob returns incorrect results when too many FDs are opened

Ronan mr_platelet+jin6vr at fastmail.fm
Sat May 26 09:55:47 UTC 2007

Package: php4-cli
Version: 6:4.4.4-8+etch3

If a script opens files until the system's limit on open file descriptors
is reached, then glob starts returning incorrect results.  The following
script demonstrates this.

#!/usr/bin/php -n
function f() {
  var_dump(glob(dirname(__FILE__) . DIRECTORY_SEPARATOR . "*")); 


do {
  $a[] = fopen(__FILE__, "r"); 
} while(is_resource($a[count($a) - 1]));

f();   # glob wrongly says the directory is empty

More information about the pkg-php-maint mailing list