You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Memory leak when class and trait declare same static property with doc block in 8.3 #12207
I think the suggested fix is almost right, except that I believe doc_comment may also be persistent. So please use zend_string_release instead of zend_string_release_ex.
Please create a pull request :)
I think the suggested fix is almost right, except that I believe doc_comment may also be persistent. So please use zend_string_release instead of zend_string_release_ex. Please create a pull request :)
quick question, would we need to do the same here ?
quick question, would we need to do the same here ?
That code is only for internal classes. I don't know if we actively support doc comments for internal classes (e.g. via stub generation). Probably, for completeness we should do the same fix there too as it's possible to call the API manually anyway. For that case, you may use zend_string_release_ex(property_info->doc_comment, 1); as internal classes are always persistent.
Activity
devnexen commentedon Sep 15, 2023
Not sure it's wrong but it might need more completion perhaps but I will defer to @Girgias @nielsdos .
ndossche commentedon Sep 16, 2023
I think the suggested fix is almost right, except that I believe doc_comment may also be persistent. So please use zend_string_release instead of zend_string_release_ex.
Please create a pull request :)
devnexen commentedon Sep 16, 2023
quick question, would we need to do the same here ?
ndossche commentedon Sep 16, 2023
That code is only for internal classes. I don't know if we actively support doc comments for internal classes (e.g. via stub generation). Probably, for completeness we should do the same fix there too as it's possible to call the API manually anyway. For that case, you may use
zend_string_release_ex(property_info->doc_comment, 1);as internal classes are always persistent.rioderelfte commentedon Sep 18, 2023
Thanks for the input!
I found this
zend_string_release_exhere:php-src/Zend/zend_opcode.c
Line 388 in 3e0e7e3
Thats why I used it in my patch as well. But I will create a PR with
zend_string_releaseand also will add the release to theelse.Fix phpGH-12207 memory leak of doc blocks of static properties