Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

nielsdos
Copy link
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.
@nielsdos nielsdos requested a review from dstogov as a code owner October 25, 2024 18:35
@nielsdos nielsdos linked an issue Oct 25, 2024 that may be closed by this pull request
@nielsdos nielsdos closed this in 757781a Oct 28, 2024
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