Repository navigation
Conversation
Member
|
so literally reporter version ... the commit needs at least Co-Authored-by tag. |
lazerg
force-pushed
the
fix/gh-24668-set-local-var-dtor
branch
from
October 25, 2026 07:51
2a847bb to
9f01e71
Compare
Contributor
Author
|
Sorry for that, added now |
Member
|
Can you add a test please, and can you check whether we need to protect the engine by using the |
Co-authored-by: yasu20200121web-prog <[email protected]>
lazerg
force-pushed
the
fix/gh-24668-set-local-var-dtor
branch
from
October 25, 2026 11:23
9f01e71 to
a098ae8
Compare
Contributor
Author
|
Added a zend_test helper and a test. It does need the garbage trick: a destructor calling debug_backtrace() could read the freed old value from the CV, and zend_set_local_var_str() had the same problem (reachable through $http_response_header), so both now store the new value before releasing the old one. |
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.
When the name matches a compiled variable,
zend_set_local_var()overwrote the slot without releasing what was already there, so any refcounted value in that CV leaked.zend_set_local_var_str()and the symbol table path both dtor the old value already, this does the same.There is no in-tree caller of
zend_set_local_var(), so I checked it by temporarily switching the$http_response_headerwrite in the http wrapper over to it: twofile_get_contents()calls in one function leak 8 blocks on a debug build before this change and none after.Fixes #24668