File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,8 @@ PHP NEWS
3737 an exception is pending. (nicolas-grekas)
3838 . Fixed pcntl_signal_dispatch() dropping the signals queued behind a handler
3939 that throws. (nicolas-grekas)
40+ . Fixed bug GH-23986 (/proc/self paths resolve to the parent process after
41+ pcntl_fork()). (Lazizbek Ergashev)
4042
4143- PDO:
4244 . Fixed PDO::setAttribute() installing a PDO::ATTR_STATEMENT_CLASS class
Original file line number Diff line number Diff line change 2727
2828#include "php.h"
2929#include "ext/standard/info.h"
30+ #include "ext/standard/php_filestat.h"
3031#include "php_signal.h"
3132#include "php_ticks.h"
3233#include "zend_exceptions.h"
Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-23986 (/proc/self paths resolve to the parent process after pcntl_fork())
3+ --EXTENSIONS--
4+ pcntl
5+ --SKIPIF--
6+ <?php
7+ if (!is_readable ('/proc/self/stat ' )) die ('skip /proc/self/stat not available ' );
8+ ?>
9+ --FILE--
10+ <?php
11+ function proc_self_pid () {
12+ return (int ) explode (' ' , file_get_contents ('/proc/self/stat ' ))[0 ];
13+ }
14+
15+ var_dump (proc_self_pid () === getmypid ());
16+ $ parent_inode = fileinode ('/proc/self ' );
17+
18+ $ pid = pcntl_fork ();
19+ if ($ pid === 0 ) {
20+ var_dump (fileinode ('/proc/self ' ) !== $ parent_inode );
21+ var_dump (proc_self_pid () === getmypid ());
22+ exit (0 );
23+ }
24+ pcntl_waitpid ($ pid , $ status );
25+ ?>
26+ --EXPECT--
27+ bool(true)
28+ bool(true)
29+ bool(true)
Original file line number Diff line number Diff line change @@ -1814,6 +1814,7 @@ PHPAPI void php_child_init(void)
18141814{
18151815 refresh_memory_manager ();
18161816 zend_max_execution_timer_init ();
1817+ php_clear_stat_cache (true, NULL , 0 );
18171818}
18181819
18191820/* {{{ php_request_startup */
You can’t perform that action at this time.
0 commit comments