Bug #66569 [Com]: Opcache interoperation with Phar fails tests

From: Date: Tue, 20 Mar 2018 12:51:34 +0000
Subject: Bug #66569 [Com]: Opcache interoperation with Phar fails tests
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214420@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66569&edit=1

 ID:                 66569
 Comment by:         leonie at netcreators dot nl
 Reported by:        Terry at ellisons dot org dot uk
 Summary:            Opcache interoperation with Phar fails tests
 Status:             Open
 Type:               Bug
 Package:            opcache
 Operating System:   N/A
 PHP Version:        master-Git-2014-01-24 (snap)
 Block user comment: N
 Private report:     N

 New Comment:

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?


Previous Comments:
------------------------------------------------------------------------
[2014-01-24 15:02:45] 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.



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



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


Thread (4 messages)

« previous php.bugs (#214420) next »