Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84606 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84873 invoked from network); 12 Mar 2015 02:01:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Mar 2015 02:01:14 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.172 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.223.172 mail-ie0-f172.google.com Received: from [209.85.223.172] ([209.85.223.172:36203] helo=mail-ie0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 76/14-64353-963F0055 for ; Wed, 11 Mar 2015 21:01:14 -0500 Received: by iegc3 with SMTP id c3so9765741ieg.3 for ; Wed, 11 Mar 2015 19:01:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=tgMQLlmgmzFwKbOygzLRw6F/dOCyudXQpRCEIY/FyCo=; b=lr2nL3i6DkN5V8yCD3hFMckvq3Vx+ojs1/HDTPVhYmsLlpdXS8G9Bx89+m0RozwsPn LhoZuvYPBGRz44rPinF1zD0i3rQ3BtHUFEXAjRWZOI08hQMcwhUCcJf2Itm1ns8rEIdQ NjhRyWhOE0yERXZfURGe2AG4j3YhYubfEpJnnrXEuR98ymj4yAD6qPqqtJzT5F1UGs1M JEBy0EH9hLB9m6ks+Ab++xZg8NvYqqfEPbj+tH77Bj3l3haBoAHOjU6PwJMODK0NnXOK PHTiS/BzvQv4Dh/ngvjN+07XKujOZ5Ttz1dFRhuUIiX2xavqzRx2gsaI29vHqcQoXjDe ceEg== MIME-Version: 1.0 X-Received: by 10.50.138.68 with SMTP id qo4mr95381257igb.33.1426125665424; Wed, 11 Mar 2015 19:01:05 -0700 (PDT) Received: by 10.64.55.200 with HTTP; Wed, 11 Mar 2015 19:01:05 -0700 (PDT) Received: by 10.64.55.200 with HTTP; Wed, 11 Mar 2015 19:01:05 -0700 (PDT) In-Reply-To: References: Date: Wed, 11 Mar 2015 19:01:05 -0700 Message-ID: To: Dmitry Stogov , Rasmus Lerdorf , Nikita Popov , Xinchen Hui , Anatol Belski , PHP Internals Content-Type: multipart/alternative; boundary=001a1134bd80b15e9705110dc1a5 Subject: Re: [PHP-DEV] Safe execution timeout handling From: smalyshev@gmail.com (Stas Malyshev) --001a1134bd80b15e9705110dc1a5 Content-Type: text/plain; charset=UTF-8 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 --001a1134bd80b15e9705110dc1a5--