[php-src] master: Merge branch 'PHP-8.6'

From: Date: Mon, 28 Sep 2026 21:40:37 +0000
Subject: [php-src] master: Merge branch 'PHP-8.6'
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-141647@lists.php.net to get a copy of this message
Author: Daniel Scherzer (DanielEScherzer) Date: 2026-09-28T14:39:55-07:00 Commit: https://github.com/php/php-src/commit/05b348e76ac3136cd0e34ac0e5d81c94e01f6b6e Raw diff: https://github.com/php/php-src/commit/05b348e76ac3136cd0e34ac0e5d81c94e01f6b6e.diff Merge branch 'PHP-8.6' * PHP-8.6: Opcache: abort process when mprotect() or VirtualProtect() calls fail (#23855) Changed paths: M ext/opcache/jit/zend_jit.c Diff: diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index 2adb934f1256..9d8e14c02176 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -3558,7 +3558,7 @@ void zend_jit_unprotect(void) opts |= PROT_EXEC; # endif if (mprotect(dasm_buf, dasm_size, opts) != 0) { - fprintf(stderr, "mprotect() failed [%d] %s\n", errno, strerror(errno)); + zend_accel_error_noreturn(ACCEL_LOG_FATAL, "mprotect() failed [%d] %s\n", errno, strerror(errno)); } } #elif defined(_WIN32) @@ -3572,8 +3572,7 @@ void zend_jit_unprotect(void) if (!VirtualProtect(dasm_buf, dasm_size, new, &old)) { DWORD err = GetLastError(); char *msg = php_win32_error_to_msg(err); - fprintf(stderr, "VirtualProtect() failed [%lu] %s\n", err, msg); - php_win32_error_msg_free(msg); + zend_accel_error_noreturn(ACCEL_LOG_FATAL, "VirtualProtect() failed [%lu] %s\n", err, msg); } } #endif @@ -3586,7 +3585,7 @@ void zend_jit_protect(void) #elif defined(HAVE_MPROTECT) if (!(JIT_G(debug) & (ZEND_JIT_DEBUG_GDB|ZEND_JIT_DEBUG_PERF_DUMP))) { if (mprotect(dasm_buf, dasm_size, PROT_READ | PROT_EXEC) != 0) { - fprintf(stderr, "mprotect() failed [%d] %s\n", errno, strerror(errno)); + zend_accel_error_noreturn(ACCEL_LOG_FATAL, "mprotect() failed [%d] %s\n", errno, strerror(errno)); } } #elif defined(_WIN32) @@ -3596,8 +3595,7 @@ void zend_jit_protect(void) if (!VirtualProtect(dasm_buf, dasm_size, PAGE_EXECUTE_READ, &old)) { DWORD err = GetLastError(); char *msg = php_win32_error_to_msg(err); - fprintf(stderr, "VirtualProtect() failed [%lu] %s\n", err, msg); - php_win32_error_msg_free(msg); + zend_accel_error_noreturn(ACCEL_LOG_FATAL, "VirtualProtect() failed [%lu] %s\n", err, msg); } } #endif @@ -3843,11 +3841,11 @@ void zend_jit_startup(void *buf, size_t size, bool reattached) #elif defined(HAVE_MPROTECT) if (JIT_G(debug) & (ZEND_JIT_DEBUG_GDB|ZEND_JIT_DEBUG_PERF_DUMP)) { if (mprotect(dasm_buf, dasm_size, PROT_READ | PROT_WRITE | PROT_EXEC) != 0) { - fprintf(stderr, "mprotect() failed [%d] %s\n", errno, strerror(errno)); + zend_accel_error_noreturn(ACCEL_LOG_FATAL, "mprotect() failed [%d] %s\n", errno, strerror(errno)); } } else { if (mprotect(dasm_buf, dasm_size, PROT_READ | PROT_EXEC) != 0) { - fprintf(stderr, "mprotect() failed [%d] %s\n", errno, strerror(errno)); + zend_accel_error_noreturn(ACCEL_LOG_FATAL, "mprotect() failed [%d] %s\n", errno, strerror(errno)); } } #elif defined(_WIN32) @@ -3857,8 +3855,7 @@ void zend_jit_startup(void *buf, size_t size, bool reattached) if (!VirtualProtect(dasm_buf, dasm_size, PAGE_EXECUTE_READWRITE, &old)) { DWORD err = GetLastError(); char *msg = php_win32_error_to_msg(err); - fprintf(stderr, "VirtualProtect() failed [%lu] %s\n", err, msg); - php_win32_error_msg_free(msg); + zend_accel_error_noreturn(ACCEL_LOG_FATAL, "VirtualProtect() failed [%lu] %s\n", err, msg); } } else { DWORD old; @@ -3866,8 +3863,7 @@ void zend_jit_startup(void *buf, size_t size, bool reattached) if (!VirtualProtect(dasm_buf, dasm_size, PAGE_EXECUTE_READ, &old)) { DWORD err = GetLastError(); char *msg = php_win32_error_to_msg(err); - fprintf(stderr, "VirtualProtect() failed [%lu] %s\n", err, msg); - php_win32_error_msg_free(msg); + zend_accel_error_noreturn(ACCEL_LOG_FATAL, "VirtualProtect() failed [%lu] %s\n", err, msg); } } #endif

« previous php.cvs (#141647) next »