Bug #65445 [Com]: filesize() fails for files with high inode number

From: Date: Mon, 11 Apr 2022 06:47:53 +0000
Subject: Bug #65445 [Com]: filesize() fails for files with high inode number
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-240837@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65445&edit=1 ID: 65445 Comment by: giw42161 at uooos dot com Reported by: michal at michal dot waw dot pl Summary: filesize() fails for files with high inode number Status: Duplicate Type: Bug Package: Filesystem function related Operating System: Linux PHP Version: 5.5.1 Block user comment: N Private report: N New Comment: Century Law Firm is the best team of lawyers for divorce case, Drt Case, High Court Matter, Civil and Criminal Cases and more in Delhi. (https://centurylawfirm.in/)gist.github.com Previous Comments: ------------------------------------------------------------------------ [2017-03-17 22:55:36] pollita@php.net Bug #45040 ------------------------------------------------------------------------ [2013-08-16 16:15:14] michal at michal dot waw dot pl Source of the problem lies in lack of support for files larger than 2GB. From what I read in different places enabling LFS in PHP is not possible, as it requires doing so in Apache and many libraries. The easiest solution for me is to force XFS to not use inode numbers greater than 2^32 ("inode32" mount option). Still I hope one day PHP will have LFS enabled. ------------------------------------------------------------------------ [2013-08-16 10:52:04] michal at michal dot waw dot pl It is a problem with stat(2) C function. For files with inode >= 2^32 it returns error: errno: 75 (Value too large for defined data type) ------------------------------------------------------------------------ [2013-08-13 21:33:24] michal at michal dot waw dot pl This is 32bit system. Here is the output: stat64("DSC_5196_fx-1553725666.JPG", {st_mode=S_IFREG|0644, st_size=1907383, ...}) = 0 write(1, "\nWarning: filesize(): stat faile"..., 96) = 96 Please tell me if I can help in any way. ------------------------------------------------------------------------ [2013-08-13 21:02:02] johannes@php.net Are you using a 32 or 64 it system? Could you please run the following on command line to see whether the syscall for stat succeeds or fails so we can narrow the search: $ strace php -nr 'filesize("DSC_5196_fx-1553725666.JPG");' The relevant output is towards the end something like stat("DSC_5196_fx-1553725666.JPG", 0x7fff38d27f80) = -1 ENOENT (No such file or directory) write(1, "\nWarning: filesize(): stat faile"..., 96 or stat("DSC_5196_fx-1553725666.JPG", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 thanks. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=65445 -- Edit this bug report at https://bugs.php.net/bug.php?id=65445&edit=1

« previous php.bugs (#240837) next »