Bug #73719 [Csd]: Suspect memory issue with certain tar.gz file / PharData
| From: | cmb@php.net | Date: | Sun, 25 Oct 2020 13:43:14 +0000 |
| Subject: | Bug #73719 [Csd]: Suspect memory issue with certain tar.gz file / PharData | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-229919@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73719&edit=1
ID: 73719
Updated by: cmb@php.net
Reported by: tklingenberg at lastflood dot net
Summary: Suspect memory issue with certain tar.gz file /
PharData
Status: Closed
Type: Bug
Package: PHAR related
Operating System: Tested on Ubuntu 16.04
PHP Version: 7.0.14
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Thanks for thoroughly checking with different PHP versions!
Previous Comments:
------------------------------------------------------------------------
[2020-10-25 11:57:31] tklingenberg at lastflood dot net
Thanks for the reminder @cmb,
> is there still an issue with PharData?
I checked it across all versions I have on my system quickly at hand (5.6 - 8.0 RC) and it is fixed
in 7.1. Looks like 5.6 and 7.0 had issues.
this looks fixed to me, closing.
find following only the report of the tests:
php 5.6: PHP 5.6.40-35+ubuntu18.04.1+deb.sury.org+1 (cli) :
Fatal error: Allowed memory size of -1 bytes exhausted (tried to allocate 18446744073709543424
bytes) in Command line code on line 1
fail.
php5.6 -dextension=phar.so -nr $p = new PharData($argv[1]); -- magento-sample-data-1.9.2.4.tar.gz
non-zero exit status: 255 [FAIL]
--
php 7.0: PHP 7.0.33-34+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Oct 18 2020 21:14:27) ( NTS ):
mmap() failed: [12] Cannot allocate memory
mmap() failed: [12] Cannot allocate memory
Fatal error: Out of memory (allocated 2097152) (tried to allocate 18446744073709543424 bytes) in
Command line code on line 1
fail.
php7.0 -dextension=phar.so -nr $p = new PharData($argv[1]); -- magento-sample-data-1.9.2.4.tar.gz
non-zero exit status: 255 [FAIL]
--
php 7.1: PHP 7.1.33-21+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Oct 18 2020 21:17:19) ( NTS ): [
OK ]
--
php 7.2: PHP 7.2.34-4+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Oct 18 2020 21:19:33) ( NTS ): [ OK
]
--
php 7.3: PHP 7.3.23-4+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Oct 18 2020 21:21:27) ( NTS ): [ OK
]
--
php 7.4: PHP 7.4.11 (cli) (built: Oct 18 2020 19:39:25) ( NTS ): [ OK ]
--
php 8.0: PHP 8.0.0rc1 (cli) (built: Oct 18 2020 19:43:26) ( NTS ): [ OK ]
--
file:
-rw-rw-r-- 1 usr grp 436207616 Okt 25 12:16 magento-sample-data-1.9.2.4.tar.gz
magento-sample-data-1.9.2.4.tar.gz: gzip compressed data, was
"magento-sample-data-1.9.2.4.tar", last modified: Mon Feb 22 15:49:22 2016, max
compression, from FAT filesystem (MS-DOS, OS/2, NT)
SHA-1: 5ad29dc3df38d21b2407c49f66d5308b01961d60 magento-sample-data-1.9.2.4.tar.gz
SHA-256: c4557f8a73ca2773f6c91b1b3b40464a8f00fa902b73edc7fddb263f125f8b7c
magento-sample-data-1.9.2.4.tar.gz
------------------------------------------------------------------------
[2020-10-25 04:22:13] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
------------------------------------------------------------------------
[2020-10-13 12:50:02] cmb@php.net
<https://github.com/netz98/n98-magerun/issues/879>
has been closed
as resolved; is there still an issue with PharData?
------------------------------------------------------------------------
[2016-12-27 07:01:45] stas@php.net
Don't see security problem here.
------------------------------------------------------------------------
[2016-12-11 22:29:06] tklingenberg at lastflood dot net
Description:
------------
One user reported an issue that a tar-gz data-file for the Magento application didn't run with
Magerun that uses Composer which then uses the PharData class under the hood.
File in question is:
URL: https://sourceforge.net/projects/mageloads/files/assets/1.9.2.4/magento-sample-data-1.9.2.4.tar.gz
SHASUM: `5ad29dc3df38d21b2407c49f66d5308b01961d60
Creating the instance based on that file:
php -r '$p = new PharData($argv[1]);' -- magento-sample-data-1.9.2.4.tar.gz
Creates the always reproduceable error:
PHP Fatal error: Allowed memory size of -1 bytes exhausted (tried to allocate 18446744073709543424
bytes) in Command line code on line 1
This large number looked suspicious to me so I reported this under security. I have not further
looked into it.
The tar-file itself is somewhat broken, if I verify it on my system I get some errors:
$ tar -tzf magento-sample-data-1.9.2.4.tar.gz >/dev/null
gzip: stdin: decompression OK, trailing garbage ignored
tar: Child returned status 2
tar: Error is not recoverable: exiting now
I hope the information provided is useful.
Ref; https://github.com/netz98/n98-magerun/issues/879
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73719&edit=1