Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87263 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65501 invoked from network); 24 Jul 2015 08:14:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jul 2015 08:14:11 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.42 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.192.42 mail-qg0-f42.google.com Received: from [209.85.192.42] ([209.85.192.42:34954] helo=mail-qg0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FA/41-57278-2D3F1B55 for ; Fri, 24 Jul 2015 04:14:10 -0400 Received: by qgii95 with SMTP id i95so7429090qgi.2 for ; Fri, 24 Jul 2015 01:14:07 -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 :cc:content-type; bh=HLdnc4BMzDArnX7qfSYLsTHn1cdeRAI42sHZoRmDol8=; b=iGjQDGpbR3PelXHcw+4SdLhj5EYXzCwHiD0nSuQRdL+A8EprMDU7QA66Auu5hP90kp CC/LcVSVgtJepPZUunj62wEFCEvnaimJlSIsfpIUozLxNoEH2IW57A50RONK3omRCKXZ ZjNh+3BQMvHciLClGc6UlYQndF/B7z2BC1F44F/4GH4fxeVhUodBW1SvR1C/QhdDwqS3 ie+PcAJ9pdFuXhLXEfvUe848iTjP1hUnbOmFIiCr1j9YMhDUBSKItjkB6Qw4Po8d4QVr pKVJdC8VCMMqhsx5KkyMysnDs7TPbLz8gIO3P91wFLxHFnWTUmSLF4Bpw2PhXWAD97HS D7oA== MIME-Version: 1.0 X-Received: by 10.55.19.19 with SMTP id d19mr18583927qkh.100.1437725647113; Fri, 24 Jul 2015 01:14:07 -0700 (PDT) Received: by 10.96.151.5 with HTTP; Fri, 24 Jul 2015 01:14:05 -0700 (PDT) Received: by 10.96.151.5 with HTTP; Fri, 24 Jul 2015 01:14:05 -0700 (PDT) In-Reply-To: References: <55B0CADD.8000807@gmx.de> <55B136BE.8010006@gmx.de> Date: Fri, 24 Jul 2015 15:14:05 +0700 Message-ID: To: Adam Harvey Cc: Christoph Becker , PHP internals Content-Type: multipart/alternative; boundary=001a114017347b12d1051b9a9666 Subject: Re: [PHP-DEV] PCRE JIT stack size limit From: pierre.php@gmail.com (Pierre Joye) --001a114017347b12d1051b9a9666 Content-Type: text/plain; charset=UTF-8 On Jul 24, 2015 10:34 AM, "Adam Harvey" wrote: > > On 23 July 2015 at 11:47, Christoph Becker wrote: > > > 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. > > I'm not a big fan of that, although it's at least in the spirit of > what configuration settings are meant to be used for. > > What if we added the PCRE_ERROR_JIT_STACKLIMIT error constant to those > exposed to userland so that it's more easily noticed via > preg_last_error(), and adding a modifier that can be used to disable > the JIT on a per-pattern basis (by setting PCRE_NO_START_OPTIMIZE, > which admittedly disables other stuff too, but at least the regex will > run)? At least then users could check the error when the regex fails > and re-run the regex without the JIT if they chose to. > > How likely is the average user to hit this, do you think? I am not sure we have accurate numbers or can have. It really depends on the expressions. A simple one can exhaust the stack as much as a apparently more complex expressions. I have to say that the default stack we use now on windows has reduced the amount of bug reports. I do not think we can eliminate it and increase it too much may bring some bad side effects as well. --001a114017347b12d1051b9a9666--