[php-src] Issue #19911: RC PHP8.5.0beta3 error from test_suite
| From: | ArchMaster2024 | Date: | Mon, 22 Sep 2025 03:57:55 +0000 |
| Subject: | [php-src] Issue #19911: RC PHP8.5.0beta3 error from test_suite | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-250874@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/19911
Author: ArchMaster2024
### Description
The following code:
```php
<?php
function split_words(?string $lines): array {
return preg_split('(\s)', trim($lines ?? ''), flags: PREG_SPLIT_NO_EMPTY);
}
function find_workers_by_ppid(string $ppid) {
return split_words(shell_exec('pgrep -P ' . $ppid));
}
function find_workers_by_pids(array $pids) {
return split_words(shell_exec('ps -o pid= -p ' . join(',', $pids)));
}
include "php_cli_server.inc";
$cliServerInfo = php_cli_server_start('');
$master = proc_get_status($cliServerInfo->processHandle)['pid'];
$workersBefore = find_workers_by_ppid($master);
if (count($workersBefore) === 0) {
throw new \Exception('Could not find worker pids');
}
proc_terminate($cliServerInfo->processHandle, 9); // SIGKILL
$try = 1;
$max_tries = 20;
while (true) {
$workersAfter = find_workers_by_pids($workersBefore);
if (count($workersAfter) === 0) {
break;
}
if ($try >= $max_tries) {
throw new \Exception('Workers were not properly terminated. Before: ' .
join(', ', $workersBefore) . ', after: ' . join(', ', $workersAfter));
}
$try++;
usleep(100_000);
}
echo 'Done';
?>
```
Resulted in this output:
```
sh: 1: pgrep: not found
Fatal error: Uncaught Exception: Could not find worker pids in
/php_build/php-8.5.0beta3/sapi/cli/tests/php_cli_server_pdeathsig.php:21
Stack trace:
#0 {main}
thrown in /php_build/php-8.5.0beta3/sapi/cli/tests/php_cli_server_pdeathsig.php on line 21
```
But I expected this output instead:
```
Done
```
### PHP Version
```plain
PHP 8.5.0beta3 (cli) (built: Sep 22 2025 03:25:05) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.5.0-dev, Copyright (c) Zend Technologies
with Zend OPcache v8.5.0beta3, Copyright (c), by Zend Technologies
```
### Operating System
Debian GNU/Linux 12 (bookworm) x86_64 (This is a docker container)