diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 75072a91009..77d8a720542 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -4629,6 +4629,8 @@ static zend_result accel_finish_startup_preload(bool in_child) SIGG(check) = false; #endif php_request_shutdown(NULL); /* calls zend_shared_alloc_unlock(); */ + EG(class_table) = NULL; + EG(function_table) = NULL; PG(report_memleaks) = orig_report_memleaks; } else { zend_shared_alloc_unlock(); diff --git a/sapi/cli/tests/bug80092.phpt b/sapi/cli/tests/bug80092.phpt new file mode 100644 index 00000000000..dadce9fc778 --- /dev/null +++ b/sapi/cli/tests/bug80092.phpt @@ -0,0 +1,36 @@ +--TEST-- +Bug #80092 (ZTS + preload = segfault on shutdown) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +preloaded +PHP %s +Copyright (c) The PHP Group +Zend Engine %s + with Zend OPcache %s diff --git a/sapi/cli/tests/preload.inc b/sapi/cli/tests/preload.inc new file mode 100644 index 00000000000..469ba934415 --- /dev/null +++ b/sapi/cli/tests/preload.inc @@ -0,0 +1,7 @@ +