Repository navigation
Conversation
PFA that can not be cached in SHM are cached in EG(partial_function_application_cache). The cache key is concat(PFA name addr, called fun addr) with the assumption that PFA names are not interned, therefore have a unique address. File cache breaks this assumption. Fix by using &ast->lineno as key prefix, which is unique as long as the AST is live. Invalidate related cache entries when destroying the AST.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up GH-25374.
PFAs that will not be cached in SHM are cached in
EG(partial_function_application_cache)instead. The cache key isconcat(PFA name addr, called fun addr)with the assumption that the name is not interned, therefore has a unique address.A file cache primed from SHM breaks this assumption: In that case the name is interned before being persisted to the file cache. On a subsequent file_cache_only request the PFA will not be SHM-cacheable, but its name will not be unique either.
Fix by using
&ast->linenoas key, which is unique as long as the AST is live. Invalidate related cache entries when destroying the AST.Fixes https://github.com/php/php-src/actions/runs/45303330074/job/138141503801#step:13:151
cc @jorgsowa