mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.3' into PHP-8.4
This commit is contained in:
commit
49bc011c9f
2 changed files with 50 additions and 1 deletions
|
@ -62,7 +62,8 @@ int fpm_status_export_to_zval(zval *status)
|
||||||
|
|
||||||
/* copy the scoreboard not to bother other processes */
|
/* copy the scoreboard not to bother other processes */
|
||||||
scoreboard = *scoreboard_p;
|
scoreboard = *scoreboard_p;
|
||||||
struct fpm_scoreboard_proc_s procs[scoreboard.nprocs];
|
struct fpm_scoreboard_proc_s *procs = safe_emalloc(
|
||||||
|
sizeof(struct fpm_scoreboard_proc_s), scoreboard.nprocs, 0);
|
||||||
|
|
||||||
struct fpm_scoreboard_proc_s *proc_p;
|
struct fpm_scoreboard_proc_s *proc_p;
|
||||||
for(i=0; i<scoreboard.nprocs; i++) {
|
for(i=0; i<scoreboard.nprocs; i++) {
|
||||||
|
@ -132,6 +133,8 @@ int fpm_status_export_to_zval(zval *status)
|
||||||
add_next_index_zval(&fpm_proc_stats, &fpm_proc_stat);
|
add_next_index_zval(&fpm_proc_stats, &fpm_proc_stat);
|
||||||
}
|
}
|
||||||
add_assoc_zval(status, "procs", &fpm_proc_stats);
|
add_assoc_zval(status, "procs", &fpm_proc_stats);
|
||||||
|
efree(procs);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
46
sapi/fpm/tests/gh16432-status-high-nprocs.phpt
Normal file
46
sapi/fpm/tests/gh16432-status-high-nprocs.phpt
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
--TEST--
|
||||||
|
FPM: GH-16432 - fpm_get_status segfault on high nprocs
|
||||||
|
--SKIPIF--
|
||||||
|
<?php include "skipif.inc"; ?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
require_once "tester.inc";
|
||||||
|
|
||||||
|
$cfg = <<<EOT
|
||||||
|
[global]
|
||||||
|
error_log = {{FILE:LOG}}
|
||||||
|
log_level = notice
|
||||||
|
[unconfined]
|
||||||
|
listen = {{ADDR}}
|
||||||
|
pm = dynamic
|
||||||
|
pm.max_children = 12800
|
||||||
|
pm.start_servers = 1
|
||||||
|
pm.min_spare_servers = 1
|
||||||
|
pm.max_spare_servers = 1
|
||||||
|
catch_workers_output = yes
|
||||||
|
EOT;
|
||||||
|
|
||||||
|
$code = <<<EOT
|
||||||
|
<?php
|
||||||
|
var_dump(empty(fpm_get_status()));
|
||||||
|
EOT;
|
||||||
|
|
||||||
|
$tester = new FPM\Tester($cfg, $code);
|
||||||
|
[$sourceFilePath, $scriptName] = $tester->createSourceFileAndScriptName();
|
||||||
|
$tester->start();
|
||||||
|
$tester->expectLogStartNotices();
|
||||||
|
$tester->request()->expectBody('bool(false)');
|
||||||
|
$tester->terminate();
|
||||||
|
$tester->expectLogTerminatingNotices();
|
||||||
|
$tester->close();
|
||||||
|
|
||||||
|
?>
|
||||||
|
Done
|
||||||
|
--EXPECT--
|
||||||
|
Done
|
||||||
|
--CLEAN--
|
||||||
|
<?php
|
||||||
|
require_once "tester.inc";
|
||||||
|
FPM\Tester::clean();
|
||||||
|
?>
|
Loading…
Add table
Add a link
Reference in a new issue