Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84588 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27659 invoked from network); 11 Mar 2015 22:23:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Mar 2015 22:23:16 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.169 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.192.169 mail-pd0-f169.google.com Received: from [209.85.192.169] ([209.85.192.169:39834] helo=mail-pd0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A4/75-32765-250C0055 for ; Wed, 11 Mar 2015 17:23:16 -0500 Received: by pdbft15 with SMTP id ft15so14570039pdb.6 for ; Wed, 11 Mar 2015 15:23:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=pRtzNBr1BWsaXT1jnlKbt4gUsCtnlxidX4sEXUGmS1o=; b=Dt/c+UJ7+VbqqrrWC0AU2Ujfprp87jrWW9f1lMZ9YFHkUjfT/x81oVu2gjz48zRhpx 32c9a7zmwmgVgeXEsnbud2Eqv0lbJ1zkjAeADr2NgG2dz4UBK3UGI+XGLrE/CkISyhDH YX0fnCiIUwmorOKtPa1d++SfW0yiQiXGORS0t7vb/UVNfqOoqImK1DOS3/xieqzGS1OD 9kxlgcxdbWeuQCkb2Utyk8lAItTHP/Fy2lpOU1irTlg/gUmkCmZyyAyOe0eiQZFAirz1 Z0S7fy5Fp5moOlp7dz2jTef7zDnncaSN4bpJQkKN7T8tkh7+iXIpubgF0ichDb17D+jn Ffeg== X-Received: by 10.70.118.134 with SMTP id km6mr77919658pdb.162.1426112590528; Wed, 11 Mar 2015 15:23:10 -0700 (PDT) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by mx.google.com with ESMTPSA id ey10sm7619634pab.47.2015.03.11.15.23.09 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Mar 2015 15:23:10 -0700 (PDT) Message-ID: <5500C04D.9000805@gmail.com> Date: Wed, 11 Mar 2015 15:23:09 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Dmitry Stogov , Rasmus Lerdorf , Nikita Popov , Xinchen Hui , Anatol Belski , PHP Internals References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Safe execution timeout handling From: smalyshev@gmail.com (Stanislav Malyshev) 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