Re: Safe execution timeout handling
| From: | Stas Malyshev | Date: | Thu, 12 Mar 2015 02:01:05 +0000 |
| Subject: | Re: Safe execution timeout handling | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-84606@lists.php.net to get a copy of this message | ||
Hi!
> Instead of throwing zend_error() from signal handler, now we just set
> EG(vm_interrupt) and EG(timed_out) flags. PHP VM checks EG(vm_interrupt)
> flag on each JMPx instruction (potential loop iteration) and then throws
JMPs are not the only operations that can transfer control and thus
potentially form a loop.
> Unfortunately this approach doesn't support interruption of long-running
> internal functions yet. It should be extended in some way. May be
> additional timeout.
Doing additional setjmp when entering internal function probably would
be too expensive. So the question is how to get out of the bad function
without incurring per-function overhead... Not sure how to do it.
--
Stas Malyshev
smalyshev@gmail.com