Bug #73946 [Opn->Fbk]: tar-based phar error on buildFromDirectory function

From: Date: Tue, 19 Jan 2021 17:52:36 +0000
Subject: Bug #73946 [Opn->Fbk]: tar-based phar error on buildFromDirectory function
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231654@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73946&edit=1

 ID:                 73946
 Updated by:         cmb@php.net
 Reported by:        escalle dot emilien at gmail dot com
 Summary:            tar-based phar error on buildFromDirectory function
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            PHAR related
 Operating System:   debian 8.3
 PHP Version:        5.6.29
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

> on a huge directory (608MB)

That doesn't mean much, so I do some guesswork.  The minimum size
of a file plus its metadata in an uncompressed tar archive is 1
KiB.  If all the files in that directory would be 256 bytes, the
tarball would exceed the 2 GiB maximum size which is supported on
32 bit systems, what would explain the error.

Is that the case?  Otherwise, can you still reproduce this issue
with any of the actively supported PHP versions[1]?

[1] <https://www.php.net/supported-versions.php>


Previous Comments:
------------------------------------------------------------------------
[2017-01-16 11:05:37] escalle dot emilien at gmail dot com

Description:
------------
Hi,

I got an error when using \PharData::buildFromDirectory on a huge directory (608MB) : 

PharException - "tar-based phar "..." cannot be created, header for  file
"..." could not be written"

I've checked the free disk space and RAM, everything seems to be ok.
I've delete the file which is specified by the error, but the errors occurs on another file.

The error is not verbose to understand what happens.

Test script:
---------------
$oTar = new \PharData('test_dir/test.tar.gz');
$oTar->buildFromDirectory('/test_dir_huge/'); // /test_dir_huge/ is a direcotry of
608MB
$oTarGz = $oTar->compress(\Phar::GZ);





------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=73946&edit=1


Thread (5 messages)

« previous php.bugs (#231654) next »