Skip to content

Fix GH-16577: EG(strtod_state).freelist leaks with opcache.preload - #16602

Closed
ndossche wants to merge 1 commit into
php:PHP-8.4from
ndossche:fix-16577
Closed

ndossche wants to merge 1 commit into
php:PHP-8.4from
ndossche:fix-16577

Conversation

@ndossche

Copy link
Copy Markdown
Member

This happens because on ZTS we execute executor_globals_ctor which reset the freelist and p5s pointers, while on NTS we don't. On NTS we can reuse the caches but on ZTS we can't, the easiest fix is to call zend_shutdown_strtod when preloading is shut down. This regressed in GH-13974 and therefore only exists in PHP 8.4 and higher.

This happens because on ZTS we execute `executor_globals_ctor` which reset the
`freelist` and `p5s` pointers, while on NTS we don't.
On NTS we can reuse the caches but on ZTS we can't, the easiest fix is
to call `zend_shutdown_strtod` when preloading is shut down.
This regressed in phpGH-13974 and therefore only exists in PHP 8.4 and
higher.
@ndossche
ndossche requested a review from dstogov as a code owner October 25, 2024 18:35
@ndossche ndossche linked an issue Oct 25, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EG(strtod_state).freelist leaks with opcache.preload

2 participants