1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00

Merge branch 'PHP-8.2' into PHP-8.3

* PHP-8.2:
  Fix #80092: ZTS + preload = segfault on shutdown
This commit is contained in:
Niels Dossche
2023-10-02 19:42:10 +02:00
4 changed files with 48 additions and 0 deletions

3
NEWS
View File

@@ -2,6 +2,9 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 8.3.0RC4
- Core:
. Fixed bug #80092 (ZTS + preload = segfault on shutdown). (nielsdos)
- CType:
. Fixed bug GH-11997 (ctype_alnum 5 times slower in PHP 8.1 or greater).
(nielsdos)

View File

@@ -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();

View File

@@ -0,0 +1,36 @@
--TEST--
Bug #80092 (ZTS + preload = segfault on shutdown)
--SKIPIF--
<?php
include 'skipif.inc';
if (substr(PHP_OS, 0, 3) == 'WIN') {
die ("skip not for Windows");
}
$extDir = ini_get('extension_dir');
if (!file_exists($extDir . '/opcache.so')) {
die ('skip opcache shared object not found in extension_dir');
}
?>
--FILE--
<?php
$cmd = [
PHP_BINARY, '-n',
'-dextension_dir=' . ini_get('extension_dir'),
'-dzend_extension=opcache.so',
'-dopcache.enable=1',
'-dopcache.enable_cli=1',
'-dopcache.preload=' . __DIR__ . '/preload.inc',
'-v'
];
$proc = proc_open($cmd, [['null'], ['pipe', 'w'], ['redirect', 1]], $pipes);
echo stream_get_contents($pipes[1]);
?>
--EXPECTF--
preloaded
PHP %s
Copyright (c) The PHP Group
Zend Engine %s
with Zend OPcache %s

View File

@@ -0,0 +1,7 @@
<?php
class SomeClass {}
function foo() {}
echo "preloaded\n";