Repository navigation
Conversation
pcntl_signal() on SIGKILL or SIGSTOP aborted the script with an uncatchable E_ERROR raised by zend_sigaction(), because sigaction() always fails for these signals. The SIG_ERR handling in pcntl_signal() was never reached. Return false with the usual "Error assigning signal" warning and EINVAL as last error instead. Fixes: php#2863
devnexen
requested changes
Nov 17, 2026
An invalid handler for SIGKILL or SIGSTOP returned false instead of throwing the TypeError or ValueError raised for every other signal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pcntl_signal()onSIGKILLorSIGSTOPaborts the script with an uncatchable fatal error raised byzend_sigaction(), becausesigaction()always fails for these signals. TheSIG_ERRhandling inpcntl_signal()is never reached. Returnfalsewith the usual "Error assigning signal" warning instead.To reproduce:
Before (8.4.26):
Fatal error: Error installing signal handler for 9After:
Warning: pcntl_signal(): Error assigning signal,bool(false),alive