Req #75939 [NEW]: opcache_invalidate requires file presence

From: Date: Thu, 08 Feb 2018 20:21:02 +0000
Subject: Req #75939 [NEW]: opcache_invalidate requires file presence
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213871@lists.php.net to get a copy of this message
From: bjornar dot ness at gmail dot com Operating system: n/a PHP version: 7.2.2 Package: opcache Bug Type: Feature/Change Request Bug description:opcache_invalidate requires file presence 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? -- Edit bug report at https://bugs.php.net/bug.php?id=75939&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75939&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75939&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75939&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=75939&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=75939&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=75939&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=75939&r=needscript Try newer version: https://bugs.php.net/fix.php?id=75939&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=75939&r=support Expected behavior: https://bugs.php.net/fix.php?id=75939&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=75939&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=75939&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=75939&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75939&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=75939&r=dst IIS Stability: https://bugs.php.net/fix.php?id=75939&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=75939&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=75939&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=75939&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=75939&r=mysqlcfg

« previous php.bugs (#213871) next »