From 96e93e9f9d36ab6b424d7f8f49a02b698b6c3542 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Thu, 2 Apr 2026 19:08:31 +0100 Subject: [PATCH] Fix GH-21600: Remove xsltCleanupGlobals call in ext/xsl MSHUTDOWN. The call to xsltCleanupGlobals() during module shutdown can cause a segfault in xmlHashFree() when freeing libxslt internal hash tables. This is the same class of shutdown cleanup issue that led to xmlCleanupParser() being removed from ext/libxml. The process is about to exit and the OS will reclaim all memory, making the explicit cleanup both unnecessary and harmful. close GH-21610 --- NEWS | 3 +++ ext/xsl/php_xsl.c | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 6a926e6118bbd..7e1e34b8ae0ed 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,9 @@ PHP NEWS . Fixed bug GH-21468 (Segfault in file_get_contents w/ a https URL and a proxy set). (ndossche) +- XSL: + . Fixed bug GH-21600 (Segfault on module shutdown). (David Carlier) + 09 Apr 2026, PHP 8.4.20 - Bz2: diff --git a/ext/xsl/php_xsl.c b/ext/xsl/php_xsl.c index dec7eb501eb2f..1484d3891aa3b 100644 --- a/ext/xsl/php_xsl.c +++ b/ext/xsl/php_xsl.c @@ -323,7 +323,6 @@ PHP_MSHUTDOWN_FUNCTION(xsl) xsltUnregisterExtModuleFunction ((const xmlChar *) "function", (const xmlChar *) "http://php.net/xsl"); xsltSetGenericErrorFunc(NULL, NULL); - xsltCleanupGlobals(); return SUCCESS; }