Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 533244 - PHP can't readdir on a very large filesystem (mine is 6TB)
Summary: PHP can't readdir on a very large filesystem (mine is 6TB)
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: PHP Bugs
URL: https://bugs.php.net/bug.php?id=60666
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-22 00:21 UTC by praise.tazio
Modified: 2014-12-22 08:53 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description praise.tazio 2014-12-22 00:21:12 UTC
THe following script will fail when readdir on a very large filesystem.


<?php
        $path = ...;
        $res = opendir ( $path );
        while ( false !== ( $file = readdir ( $res ) ) )
        {
                print_r($file);
        }
        closedir( $res );
?>

Stracing PHP from commandline I get this error:

getdents(3, 0x21ddb51c, 32768)          = -1 EOVERFLOW (Value too large for defined data type)

PHP should use getdents64.
In fact,
export CPPFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
and reinstalling solves the problem.

Reproducible: Always

Steps to Reproduce:
1.Use PHP on a 32bit system with a very large filesystem
2.Use it and fill the filesystem
3.Use code that use readdir
Actual Results:  
readdir returns false on first iteration, without anything in logs

Expected Results:  
Scanning the directory via readdir

https://bugs.php.net/bug.php?id=60666
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-12-22 08:53:50 UTC
The Gentoo project distributes source code. The project does not aim to add features or fix bugs in upstream code.