Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39732 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70434 invoked from network); 7 Aug 2008 13:03:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Aug 2008 13:03:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=arnaud.lb@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=arnaud.lb@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.182.184 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: arnaud.lb@gmail.com X-Host-Fingerprint: 64.233.182.184 nf-out-0910.google.com Received: from [64.233.182.184] ([64.233.182.184:35333] helo=nf-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F2/1D-29324-C92FA984 for ; Thu, 07 Aug 2008 09:03:25 -0400 Received: by nf-out-0910.google.com with SMTP id b11so157950nfh.13 for ; Thu, 07 Aug 2008 06:03:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:cc:references:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:message-id; bh=+E4YQF6bMEQrDXk1CQAZo613KwWOjvSIMqO/EP0FqAo=; b=o3i3OfFhotRN9Uj7CzGahFcYf58NtZtzGVcw/EAzuW9NTWNOuuAaFHxEDE4zH7Wbe2 h7PVyKOwCnejfOpdEJfpQsOJ4zCAaQJzT/9m5C+0mf4mZUTbtE7WcthjNUlYZM5qLxg8 pf6UcBTxjIVOkMYHkbnbw4O2JuXvQYM4WpGdY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding :content-disposition:message-id; b=WAG7v7QfeSMa4wbIivzaTEOC+UuKr1R+CYApafGuY1lyCKSGlz3UCSc1P4jGWhACpt zDQvkmBy8UmRzYAVp4tOBm/v4qsCHiuCqVx3fD4GVhJmn4eGYGOecCP21H43Cc7soS79 65/R7JRR2xDJYngALxHEs4Bimcs973UBa5lRs= Received: by 10.103.200.9 with SMTP id c9mr2278275muq.11.1218114201322; Thu, 07 Aug 2008 06:03:21 -0700 (PDT) Received: from 207-177-41-213.getmyip.com ( [213.41.177.207]) by mx.google.com with ESMTPS id y6sm970619mug.15.2008.08.07.06.03.19 (version=SSLv3 cipher=RC4-MD5); Thu, 07 Aug 2008 06:03:20 -0700 (PDT) To: "Nuno Lopes" Date: Thu, 7 Aug 2008 15:01:39 +0200 User-Agent: KMail/1.10.0 (Linux/2.6.26-noch; KDE/4.1.0; i686; ; ) Cc: internals@lists.php.net References: <200808071424.04620.arnaud.lb@gmail.com> <44A6E3DD049940C089EC87E672C6C252@pc07654> In-Reply-To: <44A6E3DD049940C089EC87E672C6C252@pc07654> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <200808071501.39666.arnaud.lb@gmail.com> Subject: Re: [PHP-DEV] PCRE and recursion: NO_RECURSE flag From: arnaud.lb@gmail.com (Arnaud Le Blanc) Sorry, I had not thought about that. I just checked with the example given in the bug report and it's effectively slower (~25% on this expression). On Thursday 07 August 2008 14:35:12 Nuno Lopes wrote: > No! > Last time I benchmark it, it has about 100x slower, so I don't think so.. > If you need to match large amounts of data, just increase the stack size. > ulimit is your friend :) > > Nuno > > > ----- Original Message ----- > From: "Arnaud Le Blanc" > To: > Sent: Thursday, August 07, 2008 1:24 PM > Subject: [PHP-DEV] PCRE and recursion: NO_RECURSE flag > > > Hi, > > > > PCRE can be highly recursive [1] and this can cause segmentation faults > > [2]. > > This is a known problem and the pcre ini settings avoids the segfaults, > > but > > the execution of the expression will fail anyway. > > > > PCRE has a NO_RECURSE flag which makes the match() internal function no > > recursive and avoids this problem. The configure switch for this option > > is -- > > disable-stack-for-recursion. NO_RECURSE is documented in pcre_exec.c. > > > > This can be easily enabled [3] for the bundled PCRE. It seems to be safe > > to > > enable that. Actually the PCRE test suite pass with NO_RECURSE enabled, > > and > > segfaults without. Can this be enabled ? > > > > [1] http://manpages.courier-mta.org/htmlman3/pcrestack.3.html > > [2] http://bugs.php.net/bug.php?id=45735 > > [3] http://arnaud.lb.s3.amazonaws.com/pcre_no_recurse.patch > > > > Regards, > > > > Arnaud