Commit 96e93e9f9d3 for php.net
commit 96e93e9f9d36ab6b424d7f8f49a02b698b6c3542
Author: David Carlier <devnexen@gmail.com>
Date: Thu Apr 2 19:08:31 2026 +0100
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
diff --git a/NEWS b/NEWS
index 6a926e6118b..7e1e34b8ae0 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 dec7eb501eb..1484d3891aa 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;
}