[php-src] PR #13388: Workaround ZTS persistent resource crashes (PHP 8.3 and lower)
| From: | nielsdos | Date: | Tue, 13 Feb 2024 21:15:48 +0000 |
| Subject: | [php-src] PR #13388: Workaround ZTS persistent resource crashes (PHP 8.3 and lower) | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-25078@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/13388
Author: nielsdos
For master (8.4-dev) I merged GH-13381. But that PR changes public API of TSRM, so cannot be used on
lower branches.
This patch is a safe workaround for the issue with dynamic loaded modules, in combination with a
existing fix using [
ifdef ZTS + if (module_started) inside pgsql and
odbc](https://github.com/php/php-src/blob/c2b671cb1bc61305013aa449e3cd04253f32f52a/ext/pgsql/pgsql.c#L317-L324).
The idea is to delay unloading modules until the persistent resources are destroyed. This will keep
the destructor code accessible in memory.
This is not a proper fix on its own, because we still need the workaround of not accessing globals
after module destruction. The proper fix is in master.
Note: module_registry_unload_temp does not exist.