Skip to content

Commit 131b862

Browse files
ext/opcache/zend_jit: call TSRM dtor before unloading opcache.so (php#10533)
Commit a211956 added a TSRM destructor, but that destructor will get called by tsrm_shutdown(), which is after opcache.so has already been unloaded, resulting in a shutdown crash, e.g.: #0 0x00007fad01737500 in ?? () #1 0x000055ac54e723c4 in tsrm_shutdown () at TSRM/TSRM.c:194 #2 0x000055ac54c42180 in main (argc=80, argv=0x55ac57bc14d0) at sapi/cli/php_cli.c:1388 By calling ts_free_id() before opcache.so gets unloaded, we can easily fix this crash bug.
1 parent c95125d commit 131b862

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ext/opcache/jit/zend_jit.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5078,7 +5078,9 @@ ZEND_EXT_API void zend_jit_shutdown(void)
50785078
zend_jit_perf_jitdump_close();
50795079
}
50805080
#endif
5081-
#ifndef ZTS
5081+
#ifdef ZTS
5082+
ts_free_id(jit_globals_id);
5083+
#else
50825084
zend_jit_trace_free_caches();
50835085
#endif
50845086
}

0 commit comments

Comments
 (0)