[php-src] PHP-8.4: opcache: Call orig_post_shutdown_cb()
| From: | ndossche | Date: | Tue, 27 Oct 2026 19:40:26 +0000 |
| Subject: | [php-src] PHP-8.4: opcache: Call orig_post_shutdown_cb() | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-142849@lists.php.net to get a copy of this message | ||
Author: ndossche (ndossche)
Date: 2026-10-27T20:39:21+01:00
Commit: https://github.com/php/php-src/commit/37f495c3f5f6501275295977a6aefff5db719cbb
Raw diff: https://github.com/php/php-src/commit/37f495c3f5f6501275295977a6aefff5db719cbb.diff
opcache: Call orig_post_shutdown_cb()
This was never called and resulted in this compiler warning:
```
./ext/opcache/ZendAccelerator.c:3720:15: warning: variable 'orig_post_shutdown_cb' set
but not used [-Wunused-but-set-global]
3720 | static void (*orig_post_shutdown_cb)(void);
| ^
```
Closes GH-24761.
Changed paths:
M NEWS
M ext/opcache/ZendAccelerator.c
Diff:
diff --git a/NEWS b/NEWS
index d6a2192a5ef6..72424770539b 100644
--- a/NEWS
+++ b/NEWS
@@ -157,6 +157,7 @@ PHP NEWS
handled at the end of a loop trace. (Levi Morrison)
. Fixed bug GH-24675 (function with >~1.7 MB of machine code corrupts JIT
buffer accounting). (ndossche)
+ . Call orig_post_shutdown_cb(). (ndossche)
- PDO:
. Fixed invalid ATTR_ORACLE_NULLS values being accepted and truncated.
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index b5980f2b3190..0ea820fb292c 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -3429,6 +3429,11 @@ static void (*orig_post_shutdown_cb)(void);
static void accel_post_shutdown(void)
{
+ /* Call original shutdown prior to detaching SHM, so it can access its memory safely. */
+ if (orig_post_shutdown_cb) {
+ orig_post_shutdown_cb();
+ }
+
zend_shared_alloc_shutdown();
}