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: 2021-09-19 04:22 UTC
Votes:4
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: cmb (profile)
Status: No Feedback Package: opcache
PHP Version: master-Git-2014-01-24 (snap) OS: N/A
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Terry at ellisons dot org dot uk
New email:
PHP Version: OS:

 

 [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?
 [2021-09-09 13:42 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-09-09 13:42 UTC] cmb@php.net
Is this still an issue with any of the actively supported PHP
versions[1]?

[1] <https://www.php.net/supported-versions.php>
 [2021-09-19 04:22 UTC] 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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 21:01:30 2024 UTC