[php-src] PR #24184: fix: system ID for Apache graceful restart
| From: | morrisonlevi | Date: | Wed, 07 Oct 2026 21:56:52 +0000 |
| Subject: | [php-src] PR #24184: fix: system ID for Apache graceful restart | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-39244@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/24184
Author: morrisonlevi
Apache forks workers from a parent process. During a graceful restart, PHP shuts down and starts up
again in that same parent process.
However,
finalized was not reset to 0 during subsequent startups, so all calls to
zend_add_system_entropy() would fail. This could cause the process state to diverge
from the system ID used to validate OPcache's file cache.
For example, zend_get_resource_handle() would still allocate a handle, but its entropy
would not contribute to the system ID. Enabling, disabling, or reordering extensions or features
across graceful restarts could therefore change resource-slot assignments without a corresponding
change to the system ID.
Reset finalized when initializing the system ID so each startup can register fresh
entropy.
----
I think this fix should definitely go into PHP 8.4+ but I think that RMs should consider pulling it
for 8.2-8.3. It is not a dangerous change, it's simple, and easy to understand (well, assuming
you already understand Apache graceful and system ID), and causes really nasty bugs when it's
hit.