[php-src] master: Merge branch 'PHP-8.5' into PHP-8.6
| From: | ndossche | Date: | Tue, 27 Oct 2026 19:40:27 +0000 |
| Subject: | [php-src] master: Merge branch 'PHP-8.5' into PHP-8.6 | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-142850@lists.php.net to get a copy of this message | ||
Author: ndossche (ndossche)
Date: 2026-10-27T20:40:12+01:00
Commit: https://github.com/php/php-src/commit/0c122cc676e3720bb0b49326a68661b0580da9c0
Raw diff: https://github.com/php/php-src/commit/0c122cc676e3720bb0b49326a68661b0580da9c0.diff
Merge branch 'PHP-8.5' into PHP-8.6
* PHP-8.5:
opcache: Call orig_post_shutdown_cb()
JIT: Discard veneers if generation failed
Changed paths:
M NEWS
M ext/opcache/ZendAccelerator.c
M ext/opcache/jit/zend_jit_ir.c
Diff:
diff --git a/NEWS b/NEWS
index 07a223904848..d8fda4faa8ab 100644
--- a/NEWS
+++ b/NEWS
@@ -66,6 +66,9 @@ PHP NEWS
map_ptr offset). (prateekbhujel)
. Fixed tracing JIT losing register-allocated CVs when an interrupt is
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)
- OpenSSL:
. Fixed build with OpenSSL 4.1. (Weilin Du)
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 28032182e298..c8cf5861fd55 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -3723,6 +3723,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();
}
diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c
index ca76ae39fbee..3853b71aa6b4 100644
--- a/ext/opcache/jit/zend_jit_ir.c
+++ b/ext/opcache/jit/zend_jit_ir.c
@@ -475,6 +475,15 @@ static void zend_jit_commit_veneers(void)
}
}
}
+
+static void zend_jit_discard_veneers(void)
+{
+ int i, count = sizeof(zend_jit_stubs) / sizeof(zend_jit_stubs[0]);
+
+ for (i = 0; i < count; i++) {
+ zend_jit_stub_handlers[count + i] = NULL;
+ }
+}
#endif
static bool zend_jit_prefer_const_addr_load(zend_jit_ctx *jit, uintptr_t addr)
@@ -2988,7 +2997,11 @@ static void *zend_jit_ir_compile(ir_ctx *ctx, size_t *size, const char *name)
#if defined(IR_TARGET_AARCH64)
if (ctx->flags2 & IR_HAS_VENEERS) {
- zend_jit_commit_veneers();
+ if (entry) {
+ zend_jit_commit_veneers();
+ } else {
+ zend_jit_discard_veneers();
+ }
}
#endif