File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -93,6 +93,8 @@ PHP NEWS
9393 an exception is pending. (nicolas-grekas)
9494 . Fixed pcntl_signal_dispatch() dropping the signals queued behind a handler
9595 that throws. (nicolas-grekas)
96+ . Fixed bug GH-23986 (/proc/self paths resolve to the parent process after
97+ pcntl_fork()). (Lazizbek Ergashev)
9698
9799- PDO:
98100 . Fixed PDOStatement::getColumnMeta() reading out of bounds for an invalid
Original file line number Diff line number Diff line change 2929
3030#include "php.h"
3131#include "ext/standard/info.h"
32+ #include "ext/standard/php_filestat.h"
3233#include "php_signal.h"
3334#include "php_ticks.h"
3435#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 @@ -1866,6 +1866,7 @@ PHPAPI void php_child_init(void)
18661866{
18671867 refresh_memory_manager ();
18681868 zend_max_execution_timer_init ();
1869+ php_clear_stat_cache (true, NULL , 0 );
18691870}
18701871
18711872/* {{{ php_request_startup */
You can’t perform that action at this time.
0 commit comments