Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87266 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78657 invoked from network); 24 Jul 2015 11:18:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jul 2015 11:18:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.15.18 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.15.18 mout.gmx.net Received: from [212.227.15.18] ([212.227.15.18:63773] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E9/D2-57278-5FE12B55 for ; Fri, 24 Jul 2015 07:18:20 -0400 Received: from [192.168.0.100] ([95.89.139.132]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0MMBiP-1ZHk2m3bdl-007zIH; Fri, 24 Jul 2015 13:18:09 +0200 Message-ID: <55B21EF8.1050605@gmx.de> Date: Fri, 24 Jul 2015 13:18:16 +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: Pierre Joye CC: PHP internals References: <55B0CADD.8000807@gmx.de> <55B136BE.8010006@gmx.de> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:UAeVf8/cO2NsfY5RlWs2ZSBMaXKZkCi94D9DzL33UvfI8gCGCoF POVGaD4C7Ah8K24DzcrIX5QK4VdtpWmzwsawMy5bwboda3/XFrNV2Jgk9ap4ZKLSLTAWoMw ENexLvJTySFW83y7UKXpofJPau5YW5qRi6X896mbEHZpp/u38/R9kMGLDMrevPv5sMCCCZY oaErgJBeid1NaNUSBEVvw== X-UI-Out-Filterresults: notjunk:1;V01:K0:ygMsvdNqH8k=:jMRhbaIx7IeFDbvcvc56+d T3DT12mlo36t/xN7UE2rh4zbA0WZR2VOOYWQAS6xOkv5otEIioUeqktLL4EOZbWtGHkl4erQY EW/skc8whdEBDXoKfBmAvh3h8SzKOqGACWYh6s1oFGStfDEBgxEVwf1iUau73MT18iwvQgWHT E3Gr/MmXrRh6wmrdfYxmCN3Zt14hc1W+7P36pRWCSMkm82dw/770GpPEIx1JlbD+rLCv+k7OG B82GtpS6LejSjMrPu7G1ataaiu6UFNF265WiD+OJizKgr5y/PF/3Yr35U8Q5d8olSzH9s0iqW oTW1cYLJ2hYbJ3N/yAnA9KX3BRw38lZvqp2S9cbBOljl0jYw4IYNncMquv8E1aZ6bNMSSkOGI xGh+kPhCqfEtuSPsB88PRBf3NvE6nBHajCAhZiv95Sp3oePr/7h4Ga4JsZFqXV+inVsy6mYJY butYpiFTWYMCFR75W9ayuT/gqq5IdlO5FS1T9yElIZwdxStWtYPNo5Y/AeY6FULoPisgOsoV0 LZoPLkK/Ic94wbKIMbUj+XmzJ78jaAiNHTeS2stOtk3P2HaUohOpfjVbjv1ewwhT06+4w6TNQ /XnoS9vdnV9bbyJSHwqbc9fN/VbJbZe1aj7vY3XID9GAn3FKpDYPNWSepLSSHh4/ysDCjy1Np w/MhLjgzoAPn9np+gMdQ+7WY30NDN/+d72fing9nTIdcrnz1gfiYy1Y+YiRu3YcjEV0U= Subject: Re: [PHP-DEV] PCRE JIT stack size limit From: cmbecker69@gmx.de (Christoph Becker) Pierre Joye wrote: > On Jul 23, 2015 9:47 PM, "Christoph Becker" wrote: >> >> Ah, I should have explained better that libpcre's JIT support is >> implemented as own virtual machine, and libpcre has functions to use a >> custom stack which is allocated on the heap. If these functions are not >> used (as it's now in ext/pcre) a fixed 32K on the machine stack are > used.[1] >> >> Anyhow, it is not possible to change the stack (size) during a call to >> pcre_exec() (unless, maybe, libpcre would be modified), and it is not >> possible (to my knowledge) to calculate the required stack size in >> advance. The required stack size depends on pattern and subject. >> >> So basically, we have to call pcre_exec(), and if it fails due to >> limited stack size, we either fail as well, or we try again. In the >> latter case we could either use a bigger stack or do without JIT. In >> the former case we should at least give users a setting to choose the >> desired stack size, which is quite comparable to pcre.backtrack_limit >> and pcre.recursion_limit. >> >> Therefore I tend to prefer a new ini setting (say, pcre.jitstack_limit). >> That would mean, however, to add yet another ini setting, of which >> there are already so many. >> >> [1] > > Only to be sure, ou mean it is a different issue than the common one (dozen > of bugs for pcre about it)? Solved by increasing the stack size of the > process or binary? I'm pretty sure that is another issue. The JIT functionality of libpcre is available only for PHP 7, and the issue reported in #70110 only happens when pcre.jit is enabled. And to my knowledge #70110 is the first reported bug that's caused by the JIT. > Also an ini setting may not be portable. That's something to double check :) ACK. However, AFAICT pcre_jit_stack_alloc() and pcre_assign_jit_stack() are supposed to be portable for systems where JIT support is available. -- Christoph M. Becker