Commit e74345a
committed
fix: update TSRMLS cache in APCu serializer callbacks on ZTS
The APCu (un)serializer callbacks are invoked from APCu's translation
unit, where brotli's per-module _tsrm_ls_cache is not refreshed for the
current thread. On ZTS shared builds this left the cache stale, so
PHP_VAR_SERIALIZE_INIT dereferenced a bad pointer when accessing basic
globals via BG(), crashing with SIGSEGV. NTS passed because it has no
TSRMLS cache and BG() resolves directly.
Refresh the cache with ZEND_TSRMLS_CACHE_UPDATE() at the entry of both
callbacks, mirroring php_brotli_output_encoding().1 parent 02970c6 commit e74345a
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1843 | 1843 | | |
1844 | 1844 | | |
1845 | 1845 | | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
1846 | 1849 | | |
1847 | 1850 | | |
1848 | 1851 | | |
| |||
1883 | 1886 | | |
1884 | 1887 | | |
1885 | 1888 | | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
1886 | 1892 | | |
1887 | 1893 | | |
1888 | 1894 | | |
| |||
0 commit comments