Skip to content

Commit 9bc56c3

Browse files
committed
Do not try to shut down if already in executor shut down
1 parent 8660449 commit 9bc56c3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Zend/zend_globals.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ struct _zend_executor_globals {
311311
#define EG_FLAGS_IN_SHUTDOWN (1<<0)
312312
#define EG_FLAGS_OBJECT_STORE_NO_REUSE (1<<1)
313313
#define EG_FLAGS_IN_RESOURCE_SHUTDOWN (1<<2)
314+
#define EG_FLAGS_IN_EXECUTOR_SHUTDOWN (1<<3)
314315

315316
struct _zend_ini_scanner_globals {
316317
zend_file_handle *yy_in;

main/main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1846,7 +1846,11 @@ void php_request_shutdown(void *dummy)
18461846
{
18471847
bool report_memleaks;
18481848

1849-
EG(flags) |= EG_FLAGS_IN_SHUTDOWN;
1849+
if (EG(flags) & EG_FLAGS_IN_EXECUTOR_SHUTDOWN) {
1850+
return;
1851+
}
1852+
1853+
EG(flags) |= EG_FLAGS_IN_SHUTDOWN | EG_FLAGS_IN_EXECUTOR_SHUTDOWN;
18501854

18511855
report_memleaks = PG(report_memleaks);
18521856

0 commit comments

Comments
 (0)