php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78117 Extra files in output
Submitted: 2019-06-05 19:59 UTC Modified: 2019-06-12 07:45 UTC
From: v-altruo at microsoft dot com Assigned: cmb (profile)
Status: Closed Package: Testing related
PHP Version: 7.2.19 OS: Windows
Private report: No CVE-ID: None
 [2019-06-05 19:59 UTC] v-altruo at microsoft dot com
Description:
------------
Fails across all builds (NTS/TS) regardless of opcache on/off. 
The extra files are lines 3, 8, 9 (index.php, testit, testit/exisiting.txt)

Test file location: ext\phar\tests\phar_extract.phpt

Expected result:
----------------
%sextract%cfile1.txt
%sextract%cfile2.txt
%sextract%cone
%sextract%csubdir
%sextract%csubdir%cectory
%sextract%csubdir%cectory%cfile.txt
string(2) "hi"
string(3) "hi3"
string(3) "hi2"
bool(false)
Invalid argument, expected a filename (string) or array of filenames

Warning: Phar::extractTo() expects parameter 1 to be a valid path, array given in %sphar_extract.php on line %d
Invalid argument, extraction path must be non-zero length
Unable to use path "%soops" for extraction, it is a file, must be a directory
Invalid argument, array of filenames to extract contains non-string value
Extraction from phar "%stempmanifest1.phar.php" failed: Cannot extract "file1.txt" to "%sextract/file1.txt", path already exists
string(5) "first"
string(2) "hi"
Cannot extract to "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...", destination directory is too long for filesystem
Extraction from phar "%stempmanifest1.phar.php" failed: Cannot extract "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..." to "%s...", extracted filename is too long for filesystem
===DONE===

Actual result:
--------------
C:\..\php-test-pack-7.2.19\ext\phar\tests/extract/file1.txt
C:\..\php-test-pack-7.2.19\ext\phar\tests/extract/file2.txt
C:\..\php-test-pack-7.2.19\ext\phar\tests/extract/index.php
C:\..\php-test-pack-7.2.19\ext\phar\tests/extract/one
C:\..\php-test-pack-7.2.19\ext\phar\tests/extract/subdir
C:\..\php-test-pack-7.2.19\ext\phar\tests/extract/subdir/ectory
C:\..\php-test-pack-7.2.19\ext\phar\tests/extract/subdir/ectory/file.txt
C:\..\php-test-pack-7.2.19\ext\phar\tests/extract/testit
C:\..\php-test-pack-7.2.19\ext\phar\tests/extract/testit/existing.txt
string(2) "hi"
string(3) "hi3"
string(3) "hi2"
bool(false)
Invalid argument, expected a filename (string) or array of filenames

Warning: Phar::extractTo() expects parameter 1 to be a valid path, array given in C:/../php-test-pack-7.2.19/ext/phar/tests/phar_extract.php on line 44
Invalid argument, extraction path must be non-zero length
Unable to use path "C:\..\php-test-pack-7.2.19\ext\phar\tests/oops" for extraction, it is a file, must be a directory
Invalid argument, array of filenames to extract contains non-string value
Extraction from phar "C:/../php-test-pack-7.2.19/ext/phar/tests/tempmanifest1.phar.php" failed: Cannot extract "file1.txt" to "C:\..\php-test-pack-7.2.19\ext\phar\tests/extract/file1.txt", path already exists
string(5) "first"
string(2) "hi"
Cannot extract to "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...", destination directory is too long for filesystem
Extraction from phar "C:/../php-test-pack-7.2.19/ext/phar/tests/tempmanifest1.phar.php" failed: Cannot extract "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..." to "C:\..\php-test-pack-7.2.19\ext\phar\tests/extract...", extracted filename is too long for filesystem
===DONE===

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-06-06 09:08 UTC] cmb@php.net
Thanks for reporting!

This looks like either a parellel testing issue, or a failed
cleanup from another test.  tempmanifest1.phar.php is used by
three phar tests, and the temporarily created extraction
directories are also used by multiple phar tests. This is likely
to cause parallel testing issues, and as such the phar test suite
needs review.  A provisional solution might be to mark all phar
tests as conflicting.
 [2019-06-06 09:35 UTC] cmb@php.net
-Status: Open +Status: Feedback
 [2019-06-06 09:35 UTC] cmb@php.net
Well, parallel tests are not supported by run-tests.php before PHP
7.4.  Did you run with PFTT2, or maybe multiple run-tests.php on
the same test pack/php-src?
 [2019-06-06 09:35 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2019-06-06 19:02 UTC] v-altruo at microsoft dot com
-Status: Feedback +Status: Assigned
 [2019-06-06 19:02 UTC] v-altruo at microsoft dot com
At first I ran this with pftt but then checked it with run-test.php. This is what I did and how it ended up failing. 

However, this did make me curious. I tried running the test again with run-test.php on a fresh new test pack and it passed. So I assume what you were saying about it running in parallel is what made it fail in the first place is correct.
 [2019-06-12 07:45 UTC] cmb@php.net
-Status: Assigned +Status: Closed
 [2019-06-12 07:45 UTC] cmb@php.net
Okay, then let's assume the test failure has indeed been caused by
PFTT2 and close this ticket.  (Parallel) PFFT2 testing issues of
PHP 7.3 and before can (and should) be investigated nonetheless.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 04:01:30 2024 UTC