[php-src] PR #24644: Fix GH-23859: Reset map pointer watermark in accel_activate()
| From: | aasul | Date: | Sat, 24 Oct 2026 13:38:43 +0000 |
| Subject: | [php-src] PR #24644: Fix GH-23859: Reset map pointer watermark in accel_activate() | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-39816@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/24644
Author: aasul
Fixes #23859
i looked into the map pointer growth after repeated
opcache_reset() calls and found
that surviving FPM workers could keep an outdated CG(map_ptr_last) value after a
restart
when those workers cached new scripts the old watermark would get published back into shared memory
causing the map pointer table to keep growing after each reset
the fix resets the local watermark during activation while keeping startup and preloaded slots
intact
i also added an FPM regression test using two separate workers to make sure the map pointer count
stays stable when another worker triggers a reset
the test fails on the original code and passes with the fix, i also ran it 20 times without any
failures
after 24 reset cycles the original version went from 933 to over 18000 map pointer slots while the
patched version stayed at 933
NTS and ZTS both passed 6031 tests with no failures and i also checked concurrent FPM requests,
worker replacement, preloading, JIT and ASan
LeakSanitizer still reported some allocations during worker shutdown but the same ones also appeared
on unchanged builds so nothing new seems to have been introduced
i haven't tested Windows, 32 bit platforms or threaded web SAPIs
> investigation and testing were assisted by AI and fully reviewed by human eyes.