php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66569 Opcache interoperation with Phar fails tests
Submitted: 2014-01-24 15:02 UTC Modified: -
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (33.3%)
From: Terry at ellisons dot org dot uk Assigned:
Status: Open Package: opcache
PHP Version: master-Git-2014-01-24 (snap) OS: N/A
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2014-01-24 15:02 UTC] Terry at ellisons dot org dot uk
Description:
------------
The following list of Phar tests pass when run with -d opcache.enable=0 but fail when run with -d opcache.enable=1 -d opcache.enable_cli=1

  create_new_and_modify.phpt
  delete_in_phar.phpt
  delete_in_phar_confirm.phpt
  tar/create_new_and_modify.phpt
  tar/delete_in_phar.phpt
  tar/delete_in_phar_confirm.phpt
  zip/create_new_and_modify.phpt
  zip/delete_in_phar.phpt
  zip/delete_in_phar_confirm.phpt

The issue seems to be a common mode one. For example in create_new_and_modify.phpt, the script ini_sets opcache.revalidate_freq=0 if OPcache is enabled. It then creates a Phar container 

  phar://<file_root>.phar.php

where file_root is __FILE__ less the .phpt extension, and adds an element a.php containing "brand new!".  It then includes
 
  phar://<file_root>.phar.php/a.php

and replaces the element a.php with new contents "modified!" and reincludes

  phar://<file_root>.phar.php/a.php

The test expects the result "modified!" which is what happens if OPcache is disabled.  However when enabled, this returns the previously cached "brand new!".  This is probably an OPcache bug rather than a Phar one since the revalidate frequency is set to "always revalidate".

I'll put this on my TODO list to track down, but it's low priority. I just wanted to log the issue though since these test do fail run-test.php for the PHP-5.6 release if OPcache is enabled.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-03-20 12:51 UTC] leonie at netcreators dot nl
This bug is still open since 2014 and might make things fail in today's PHP 7 real life:

https://github.com/xperseguers/t3ext-extractor/issues/5

Is there any update from the official side?
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Jun 18 11:01:27 2019 UTC