Skip to content

Commit 6f17c69

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: Fix RC assertion in fpm when php_admin_value setting fails
2 parents 73fc2db + 15beb14 commit 6f17c69

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ PHP NEWS
1414
. Fixed date_sunrise() and date_sunset() with partial-hour UTC offset.
1515
(ilutov)
1616

17+
- FPM:
18+
. Fixed failed debug assertion when php_admin_value setting fails. (ilutov)
19+
1720
- Opcache:
1821
. Fixed bug GH-19493 (JIT variable not stored before YIELD). (Arnaud)
1922

sapi/fpm/fpm/fpm_php.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ static int fpm_php_zend_ini_alter_master(char *name, int name_length, char *new_
4141
ini_entry->modifiable = mode;
4242
}
4343
} else {
44+
/* The string wasn't installed and won't be shared, it's safe to drop. */
45+
GC_MAKE_PERSISTENT_LOCAL(duplicate);
4446
zend_string_release_ex(duplicate, 1);
4547
}
4648

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
--TEST--
2+
RC violation on failed php_admin_value
3+
--SKIPIF--
4+
<?php include "skipif.inc"; ?>
5+
--FILE--
6+
<?php
7+
8+
require_once "tester.inc";
9+
10+
$cfg = <<<EOT
11+
[global]
12+
error_log = {{FILE:LOG}}
13+
[unconfined]
14+
listen = {{ADDR}}
15+
pm = dynamic
16+
pm.max_children = 5
17+
pm.start_servers = 1
18+
pm.min_spare_servers = 1
19+
pm.max_spare_servers = 3
20+
php_admin_value[precision]=-2
21+
EOT;
22+
23+
$code = <<<EOT
24+
<?php
25+
var_dump(ini_get('precision'));
26+
EOT;
27+
28+
$ini = <<<EOT
29+
precision=14
30+
EOT;
31+
32+
$tester = new FPM\Tester($cfg, $code);
33+
$tester->setUserIni($ini);
34+
$tester->start();
35+
$tester->expectLogStartNotices();
36+
$tester->request()->expectBody(['string(2) "14"']);
37+
$tester->terminate();
38+
$tester->close();
39+
40+
?>
41+
Done
42+
--EXPECT--
43+
Done
44+
--CLEAN--
45+
<?php
46+
require_once "tester.inc";
47+
FPM\Tester::clean();
48+
?>

0 commit comments

Comments
 (0)