Commit 171f81f4a48 for php
commit 171f81f4a48b338ad46b5b13bc36c043bb3a3543
Author: David Carlier <devnexen@gmail.com>
Date: Thu Oct 15 19:23:04 2026 +0100
Fix GH-24321: reset global_map_ptr_last on shutdown.
Close GH-24359
diff --git a/NEWS b/NEWS
index 1e49099b171..1d855a4b1ec 100644
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,9 @@ PHP NEWS
. Fix memory leak for nested HTTP calls. (EdmondDantes)
. Fixed pthread attribute leak in zend_call_stack_get_netbsd_pthread().
(David Carlier)
+ . Fixed bug GH-24321 (ZTS: global_map_ptr_last survives zend_shutdown(),
+ so an in-process engine restart keeps growing the map_ptr table).
+ (David Carlier)
- Date:
. Fixed bug GH-20503 (Assertion failure with ext/date DateInterval property
diff --git a/Zend/zend.c b/Zend/zend.c
index 8fea4e57e5e..da78dc0c2e8 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -1219,6 +1219,7 @@ void zend_shutdown(void) /* {{{ */
#endif
zend_map_ptr_static_last = 0;
zend_map_ptr_static_size = 0;
+ global_map_ptr_last = 0;
zend_destroy_rsrc_list_dtors();