Repository navigation
Conversation
|
so literally reporter version ... the commit needs at least Co-Authored-by tag. |
2a847bb to
9f01e71
Compare
|
Sorry for that, added now |
|
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 <258152685+yasu20200121web-prog@users.noreply.github.com>
9f01e71 to
a098ae8
Compare
|
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. |
ndossche
left a comment
There was a problem hiding this comment.
Good.
Who is yasu20200121web-prog btw?
|
They opened GH-24668, and the first version of this fix was the patch they suggested there, so I credited them as co-author. |
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