Re: Safe execution timeout handling
| From: | Dmitry Stogov | Date: | Wed, 11 Mar 2015 22:59:26 +0000 |
| Subject: | Re: Safe execution timeout handling | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-84599@lists.php.net to get a copy of this message | ||
On Thu, Mar 12, 2015 at 1:46 AM, Stanislav Malyshev <smalyshev@gmail.com>
wrote:
> Hi!
>
> > 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.
>
> I remember such proposal floating on the list recently, with two-stage
> timeouts. But wouldn't killing the process run the same risk that it
> left something messed up in SHM?
>
yes :(
if we try to recovery from some inconsistent state we most probably crash.
I even don't talk about memory and resource leaks.
> Also, in threaded environments that's probably not an option, and PHP
> may not even own the thread.
>
I'm not sure how the existing setjmp/longjmp based timeout handling works
in ZTS environment now, because except of SHM it may also easily corrupt
the process memory shared with other threads.
Thanks. Dmitry.
>
> --
> Stas Malyshev
> smalyshev@gmail.com
>