[php-src] PR #25856: Fix proc_nice_basic.phpt in a PID namespace
| From: | inode64 | Date: | Sat, 28 Nov 2026 00:12:16 +0000 |
| Subject: | [php-src] PR #25856: Fix proc_nice_basic.phpt in a PID namespace | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-41141@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25856
Author: inode64
The description below was drafted with an LLM (Claude Code, Claude Opus 5.5) and reviewed before
posting.
>
proc_nice_basic.phpt compares the niceness that
> ps -p <getmypid()> reports. In a PID namespace whose
> /proc still belongs to the parent namespace,
> getmypid() is a PID of the new namespace and
> ps looks up an unrelated process of the parent one, or fails with
> fatal library error, lookup self. This is how Gentoo's Portage
> runs the test suite (pid-sandbox), and it is easy to reproduce:
>
> ```
> $ unshare -Urpf php -r 'echo getmypid(), " | ", shell_exec("ps -p
> ".getmypid()." -o pid,nice,comm | tail -n 1");'
> 1 | 1 0 systemd
> ```
>
> On Linux the test now reads the niceness with nice(1), which
> prints the niceness it inherits from the calling process, whatever namespace
> ps would look in. Other systems keep using
> ps.
>
> Tested with PHP 8.4.28 on Linux (run-tests.php with
> TEST_PHP_EXECUTABLE):
>
> | | normal | unshare -Urpf |
> |---|---|---|
> | before | PASS | FAIL |
> | after | PASS | PASS |
>
> The same change has been carried by the PHP 8.4 and 8.5 ebuilds of our Gentoo overlay:
> https://github.com/inode64/inode64-overlay/blob/main/dev-lang/php/files/php-8.4-proc-nice-pid-namespace.patch
🤖 Generated with [Claude Code](https://claude.com/claude-code)