Fix GH-21600: Remove xsltCleanupGlobals call in ext/xsl MSHUTDOWN.#21610
Fix GH-21600: Remove xsltCleanupGlobals call in ext/xsl MSHUTDOWN.#21610devnexen wants to merge 1 commit intophp:PHP-8.4from
Conversation
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.
|
It's a bit strange. I'd like to first better understand what is causing the segfault. |
|
I ran it under Valgrind with USE_ZEND_ALLOC=0 — valgrind is clean, but I wasn't able to reproduce the same circumstances as the original report (many shared That said, this is the same class of bug that was fixed in ext/libxml by 8742276 where xmlCleanupParser() was removed from xsltCleanupGlobals() is the xslt-side equivalent — it tears down global state (frees xsltFunctionsHash, xsltExtMutex, resets initialized = 0) that can be re-entered |
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.