|  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
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
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.
Block user comment
Status: Assign to:
Bug Type:
From: bjornar dot ness at gmail dot com
New email:
PHP Version: OS:


 [2018-02-08 20:21 UTC] bjornar dot ness at gmail dot com
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?


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Jan 28 06:01:26 2021 UTC