Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87590 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94096 invoked from network); 4 Aug 2015 00:35:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Aug 2015 00:35:05 -0000 Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.15.19 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.15.19 mout.gmx.net Received: from [212.227.15.19] ([212.227.15.19:57320] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 57/92-11948-3B800C55 for ; Mon, 03 Aug 2015 20:35:00 -0400 Received: from [192.168.0.100] ([95.89.139.132]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0MWC9x-1ZKbqw1wEr-00XO15; Tue, 04 Aug 2015 02:34:55 +0200 Message-ID: <55C008B1.2050008@gmx.de> Date: Tue, 04 Aug 2015 02:34:57 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Anatol Belski , 'Christoph Becker' , 'Pierre Joye' CC: 'PHP internals' References: <55B0CADD.8000807@gmx.de> <55B136BE.8010006@gmx.de> <046401d0c644$9cf76880$d6e63980$@belski.net> <55B2B78A.4080202@gmx.de> <048001d0c665$ed19ec40$c74dc4c0$@belski.net> <55B2D779.9090409@gmx.de> <04d301d0c6e5$6b28f0c0$417ad240$@belski.net> <55B3B2E6.7080905@gmx.de> <056e01d0c7d9$b1edd990$15c98cb0$@belski.net> <55B559C7.9060304@gmx.de> <064301d0c85f$5260ac60$f7220520$@belski.net> In-Reply-To: <064301d0c85f$5260ac60$f7220520$@belski.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:aUSYWN06T3jhlOWaeoJS2xEpJsYvYbHKY2r/h0nj6Yr5Wa39A+0 Vhn1NEXc8mDTpXMXfIwDyda6hoK7sfzUXNcAnkTpf6tkAxihdjlWCZK6+DwepEzgijYIV72 cHcJl+LxbNT8ICi6mBdiYCm0uhoIlQvjdzjs38YBYGbVTPwvm+esKnxWp9Svz6TbevZlY9W 8VzTM0kjfhSqCOBvb/zCQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:J1Q8MCon5WY=:gzdtOzTw8BZ3OeShHtyUJG YXjYH2pYMB7GveN2BN2IpqCx7HQDVU28rTSs+0Sgg7Za4R3F7k3zJdPrAg3UdaEpwtZ2YvoF7 CKCpdIR6FBfW0frmurYL5pxRc1UY+4d5pkEffd5dkvdRDKl9dogsYe+DsShWaP1EIhUhmVDPa 1Dtn4vEMT8DsSA20EyvxPS6XVp0wMtSSQSHvohEnIxdkxUNTVSio6sQqs6ewtfYksz7FYpSxm OKli74Oxl9Jl7fSaySwraaEfaFoTgXeobKphuzTAs8ejnYLSebQOHqCXe2V/EvM2INsDKLlOo rw4v25mFW6WHKQ4CG5fxs7KnbkOyHkqJw8flr1Mr/7G5dvDeL2Xab9JAbYcuJGMLgmCG5A69n 8MP4U2XIPc+BNKVaXKRugCettqhvRIxNxM9wc33dgTiBEAnptF1JcC8uoI/VeP/a+KvJF4RLV X5PiYmFRjasGPEi4d7d0SZifcTdO9ZNKxTwVn0gCQ1hrwT0+2VLR0fN9Pm7xeHgbPSDWZ79j6 s0n+g/Qd0hWfZeNEbaY73aeIiwFSEMS6nuQDRUfPBP2AAZJ4rCDK1ZA/1lMN18V2r5TVzW+Fe 6yRQaDIrXPZW9y/S6PDE5ZW5KCIwRMZd3mxwJwxNXqKY+7MlaVFrnK6a3GX9IHFbP3M46K1rl j1lVqjO3EipL1HZYNHpY00sINJSycUmve2qXxws/yZUZWgsIc4FrOcZI3RKLmf9gyKlM= Subject: Re: [PHP-DEV] PCRE JIT stack size limit From: cmbecker69@gmx.de (Christoph Becker) On 27.07.2015 at 13:28, Anatol Belski wrote: >> -----Original Message----- >> From: Christoph Becker [mailto:cmbecker69@gmx.de] >> Sent: Monday, July 27, 2015 12:06 AM >> To: Anatol Belski ; 'Pierre Joye' >> >> Cc: 'PHP internals' >> Subject: Re: [PHP-DEV] PCRE JIT stack size limit >> >> Definitely interesting ideas. However, currently I'm leaning towards a full- >> fledged solution in PHP 7.1 (whatever that may be), and to only add the error >> constant for PHP 7.0. Users can set pcre.jit=0 in php.ini and not change the >> setting during runtime, if necessary. >> >> FWIW, some hours ago I've implemented the clean whole cache solution: >> > src/commit/c41d78046da48db2fa8f5bd82fd6ac58099288f8>. > > I wrote this script to test it https://gist.github.com/weltling/cd7f8127378989cca87c , but as expected - cache reset make a significant impact when the cache is full. Though, maybe as it's an exceptional situation, it were the simplest solution. Because it does not affect the normal usage, maybe it's ok for 7.0. Maybe we should give this flexibility, still in doubt. But the constant IMHO should be done anyway. IMHO we shouldn't introduce the cache clearing. As your test script shows, the performance might suffer considerably when switching pcre.jit in a running script. Furthermore cached regexps currently in use (e.g. via preg_replace_callback) can't be cleared, what might lead to confusion (in very rare cases, though). As it is now users can set pcre.jit=0 and so will retain full compatibility with PHP 5. If they're running with pcre.jit=1, they're able to get a meaningful error (PREG_JIT_STACKLIMIT_ERROR), if the default stack is not large enough (what indeed might rarely be the case). If we leave it as this, I suggest to make pcre.jit PHP_INI_PERDIR instead of PHP_INI_ALL for PHP 7.0. That still gives users the option to disable it (ideally even on shared hosting), but avoids issues when dynamically switching the setting with regard to our regexp caching. If we find a better solution for PHP 7.1, we still can extend it to PHP_INI_ALL without a BC break. For PHP 7.1 it might be worthwhile to consider to store jitted resp. non-jitted regexps in the cache, and to fetch what fits to the current setting of pcre.jit (and otherwise to compile again, adding the new entry to the cache, or maybe replacing it). -- Christoph M. Becker