[php-src] PR #21293: Fix proc_close() signal exit code handling
| From: | alies-dev | Date: | Wed, 25 Feb 2026 09:20:36 +0000 |
| Subject: | [php-src] PR #21293: Fix proc_close() signal exit code handling | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-35022@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/21293
Author: alies-dev
When a child process spawned via
proc_open() is killed by a signal,
proc_close() returns a raw/mangled waitpid status instead of a meaningful exit code.
This makes it impossible to distinguish between "exited normally with code 11" and
"killed by SIGSEGV".
The fix adds proper WIFSIGNALED()/WTERMSIG() handling in
proc_open_rsrc_dtor() (which proc_close() calls internally), returning
128 + signal_number — the same convention used by bash and other shells.
proc_get_status() already handled this correctly via its
signaled/termsig fields; only the proc_close() return value
was broken.
Fixes GH-21292