Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39731 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62272 invoked from network); 7 Aug 2008 12:35:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Aug 2008 12:35:21 -0000 Authentication-Results: pb1.pair.com header.from=nlopess@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=nlopess@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 212.55.154.21 as permitted sender) X-PHP-List-Original-Sender: nlopess@php.net X-Host-Fingerprint: 212.55.154.21 relay1.ptmail.sapo.pt Linux 2.4/2.6 Received: from [212.55.154.21] ([212.55.154.21:33082] helo=sapo.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 58/7B-29324-70CEA984 for ; Thu, 07 Aug 2008 08:35:21 -0400 Received: (qmail 4353 invoked from network); 7 Aug 2008 12:35:15 -0000 Received: from unknown (HELO sapo.pt) (10.134.37.162) by relay1 with SMTP; 7 Aug 2008 12:35:15 -0000 Received: (qmail 13265 invoked from network); 7 Aug 2008 12:35:17 -0000 X-AntiVirus: PTMail-AV 0.3-0.93.0 X-Scan-Status: AV clean (0.00790 seconds); AS clean (0.02310 seconds) Received: from unknown (HELO pc07654) (nunoplopes@sapo.pt@[85.240.54.128]) (envelope-sender ) by mta12 (qmail-ldap-1.03) with SMTP for ; 7 Aug 2008 12:35:17 -0000 Message-ID: <44A6E3DD049940C089EC87E672C6C252@pc07654> To: "Arnaud Le Blanc" , References: <200808071424.04620.arnaud.lb@gmail.com> In-Reply-To: <200808071424.04620.arnaud.lb@gmail.com> Date: Thu, 7 Aug 2008 13:35:12 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18000 Subject: Re: [PHP-DEV] PCRE and recursion: NO_RECURSE flag From: nlopess@php.net ("Nuno Lopes") 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