From 6704c605894e6bd62cc4605417aef066fd5a83c8 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Wed, 19 Jun 2024 20:45:05 +0100 Subject: [PATCH] Fix GH-14596: phpdbg with asan and ZC_RC_DEBUG set crashes. close GH-14607 --- NEWS | 4 ++++ sapi/phpdbg/phpdbg.c | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index e2744458f94..061a9e9483a 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.2.22 +- PHPDBG: + . Fixed bug GH-14596 (crashes with ASAN and ZEND_RC_DEBUG=1). + (David Carlier) + 04 Jul 2024, PHP 8.2.21 diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index d4ffcdf473d..3aa0b7b60d7 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -229,13 +229,13 @@ static PHP_RINIT_FUNCTION(phpdbg) /* {{{ */ if (zend_vm_kind() != ZEND_VM_KIND_HYBRID) { /* phpdbg cannot work JIT-ed code */ - zend_string *key = zend_string_init(ZEND_STRL("opcache.jit"), 1); - zend_string *value = zend_string_init(ZEND_STRL("off"), 1); + zend_string *key = zend_string_init(ZEND_STRL("opcache.jit"), false); + zend_string *value = zend_string_init(ZEND_STRL("off"), false); - zend_alter_ini_entry(key, value, ZEND_INI_SYSTEM, ZEND_INI_STAGE_STARTUP); + zend_alter_ini_entry_ex(key, value, ZEND_INI_SYSTEM, ZEND_INI_STAGE_STARTUP, false); - zend_string_release(key); - zend_string_release(value); + zend_string_release_ex(key, false); + zend_string_release_ex(value, false); } return SUCCESS;