From 18d3e56f04204b8cc8004164098857d91d1f8da3 Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Thu, 15 Oct 2026 17:00:02 +0200 Subject: [PATCH 1/2] JIT: Fix TLS access with SHM reattachment --- ext/opcache/jit/zend_jit_ir.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index 7423a22b709c..0bad8e1605b5 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -3412,6 +3412,10 @@ static void zend_jit_setup(bool reattached) #endif #ifdef ZTS +# ifdef ZEND_OPCACHE_SHM_REATTACHMENT + /* Different processes may load TLS variables in a different order, so we + * can not rely on offsets. We will fallback to runtime resolution. */ +# else zend_result result = zend_jit_resolve_tsrm_ls_cache_offsets( &tsrm_ls_cache_tcb_offset, &tsrm_tls_index, @@ -3421,6 +3425,7 @@ static void zend_jit_setup(bool reattached) zend_accel_error(ACCEL_LOG_INFO, "Could not get _tsrm_ls_cache offsets, will fallback to runtime resolution"); } +# endif #endif #if !defined(ZEND_WIN32) && !defined(IR_TARGET_AARCH64) From c431121edba4c008bff4a2833440bd2f8f8e11eb Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Fri, 16 Oct 2026 19:16:46 +0200 Subject: [PATCH 2/2] [ci skip] NEWS --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS index 3b782b201dd9..03e260b79e1b 100644 --- a/NEWS +++ b/NEWS @@ -60,6 +60,8 @@ PHP NEWS in closures). (RV7PR) . Fixed bug GH-24337 (JIT: segfault when decrementing a non-numeric string property). (Lazizbek Ergashev) + . Fixed bug GH-24185 (Windows ZTS: random access violations with OPcache JIT + in multi-process setups). (Arnaud, ndossche) - PDO: . Fixed a duplicate warning when ATTR_STATEMENT_CLASS is rejected on a