Re: [RFC] Zend Signal Handling
| From: | Lucas Nealan | Date: | Tue, 05 Aug 2008 10:28:19 +0000 |
| Subject: | Re: [RFC] Zend Signal Handling | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-39660@lists.php.net to get a copy of this message | ||
On 8/4/08 11:51 PM, "Arnaud Le Blanc" <arnaud.lb@gmail.com> wrote:
> global_sigmask is initialized using sigfillset(), so it contains _all_ signals
> (except SIGSEGV, etc because non-blockable or not safe to block) and there is
> no need to add signals to global_sigmask it in zend_signal() /
> zend_signal_register() :)
Right you are. Apparently I saw it was doing that but it didn't really
register.
> For extensions IMO we should just let them use zend_signal() as it currently
> is. Using pcntl_signal() will override handlers previously set by
> zend_signal() but the signal will remain deferred.
I don't see how it would continue to be deferred. We'd be relying on the
fact that pcntl depends on a tick or call to the dispatch function to
actually invoke any userspace code. Once registering a signal via pcntl I'm
able to jump out of a critical section into pctl_signal_handler when a
signal is received. This code might be safe since it doesn't do very much
but I don't get real protection.
> I updated the patches on the wiki:
> - Added zend_sigaction()
> - Ported PCNTL to use zend_sigaction()
> - Fixed handling of SIG_IGN
Great. I'll pull these down.
-lucas