On Thu, Mar 12, 2015 at 1:23 AM, Stanislav Malyshev <smalys...@gmail.com>
wrote:

> 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
>
> That looks very nice but makes timeouts much less powerful. I think
> without some ability to interrupt internal functions it won't be good.
>

agree. This is why I ask for ideas.


>
> > 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.
>

The problem is not in overhead. If we longjmp() from signal handler we
always may have something partially uninitialized and this leads may lead
to crash on request shutdown and SHM pollution.

I think, after "max_execution_time" is exceeded, we may start another
"hard_timeout", and in case the EG(vm_interrupt) wasn't handled "safely",
kill the process.

Thanks. Dmitry.





>
> --
> Stas Malyshev
> smalys...@gmail.com
>

Reply via email to