Bug #73069 [Asn->Csd]: readfile() mangles files larger than 2G

From: Date: Tue, 18 Oct 2016 11:51:20 +0000
Subject: Bug #73069 [Asn->Csd]: readfile() mangles files larger than 2G
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204892@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73069&edit=1 ID: 73069 Updated by: kaplan@php.net Reported by: ellinger at six dot de Summary: readfile() mangles files larger than 2G -Status: Assigned +Status: Closed Type: Bug Package: Streams related PHP Version: 5.6.26RC1 Assigned To: laruence Block user comment: N Private report: N New Comment: Done at ac07008bb7eeee46c9e45c976fc3dc264f0eadff (part of 5.6.27) Previous Comments: ------------------------------------------------------------------------ [2016-09-15 00:44:09] yohgaki@php.net Disregard previous comment. readfile() only read file and output directly. IIRC, it uses mmap() with fixed buffer size. It could be extended probably. ------------------------------------------------------------------------ [2016-09-15 00:30:27] yohgaki@php.net We support reading large file by chunk, but 2GB or more string support is only in PHP 7.0+, isn't it? ------------------------------------------------------------------------ [2016-09-13 13:52:49] cmb@php.net @laruence Has there be a particular reason that bug #72505 had been fixed for PHP 7.0+ only? ------------------------------------------------------------------------ [2016-09-13 06:48:06] ellinger at six dot de Description: ------------ See bug #72505 posted for Version 7.0. This seems to be still an issue in the 5.6 branch. Readfile simply starts all over again at the 2GB border, i. e. repeating Bytes 0 + x, resulting in corrupted output. Requesting a cherry pick. :-) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73069&edit=1

« previous php.bugs (#204892) next »