Re: Safe execution timeout handling

From: Date: Wed, 11 Mar 2015 22:23:09 +0000
Subject: Re: Safe execution timeout handling
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-84588@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 That looks very nice but makes timeouts much less powerful. I think without some ability to interrupt internal functions it won't be good. > 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

« previous php.internals (#84588) next »