php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #75939 opcache_invalidate requires file presence
Submitted: 2018-02-08 20:21 UTC Modified: 2018-02-08 20:42 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: bjornar dot ness at gmail dot com Assigned:
Status: Open Package: opcache
PHP Version: 7.2.2 OS: n/a
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2018-02-08 20:21 UTC] bjornar dot ness at gmail dot com
Description:
------------
opcache_invalidate()/zend_accel_invalidate does:

        realpath = accelerator_orig_zend_resolve_path(filename, filename_len);

        if (!realpath) {
                return FAILURE;
        }

accelerator_orig_zend_resolve_path ends up calling php_resolve_path that again
does a tsrm_realpath() that ends up doing lstat() that in the end makes php_resolve_path return NULL and zend_accel_invalidate return FAILURE.

This means it is not possible to invalidate a file that is removed from the filesystem without flushing the entire opcache. This can be problematic in general and for esoteric in particular.

I understand the fact that one might try to resolve symlinks to find real cache key, but there should imho be a way to override this and enable the invalidation.

Another related issue is that opcache_invalidate does not actually free up memory, just marks the cached code as corrupted. How impossible would it
be to implement a opcache_delete call that would do all this?


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 13:01:25 2019 UTC