Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39730 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57968 invoked from network); 7 Aug 2008 12:25:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Aug 2008 12:25:51 -0000 Authentication-Results: pb1.pair.com header.from=arnaud.lb@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=arnaud.lb@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.182.191 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.191 nf-out-0910.google.com Received: from [64.233.182.191] ([64.233.182.191:31481] helo=nf-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 12/8A-29324-DC9EA984 for ; Thu, 07 Aug 2008 08:25:50 -0400 Received: by nf-out-0910.google.com with SMTP id b11so151725nfh.13 for ; Thu, 07 Aug 2008 05:25:47 -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:mime-version:content-type:content-transfer-encoding :content-disposition:message-id; bh=mErKjKzLlyM+PCA8YGRFVwjGYatc1rEWnr7icHsIwuc=; b=kSTUiWCgdYflTB7aU0TZvBb5Y5RLNPmlQSIVNBr45pltTI38ySM+rGptgh98kjDdpZ AomgYh9iT8+vq+bh8O8vBwWIUEQj6j39qIVaqkfWLfWSChR5cJF6fsJnB4x38hVGkelN Bypt0BhOJFLyaYvGf/bQp7+S3e6FHE84AeVhI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:mime-version:content-type :content-transfer-encoding:content-disposition:message-id; b=M1yNmbbtWGi0Ru52kF/MGkCEE/n22Xzw6FG0b0tWJQgDCI5LipHcoc9zSnWyHxDHtz F6vTNqvruJrvlz1J99AO0S+HVObPHkIIV2MC2rVpEkXAWrBQoJ+uS9QTyTJvakpqKovW 7soRewBsO+GEWzig7pAtTm4Xn9l7tN62+RfFo= Received: by 10.103.134.20 with SMTP id l20mr2215039mun.132.1218111946321; Thu, 07 Aug 2008 05:25:46 -0700 (PDT) Received: from 207-177-41-213.getmyip.com ( [213.41.177.207]) by mx.google.com with ESMTPS id s10sm9943713muh.10.2008.08.07.05.25.44 (version=SSLv3 cipher=RC4-MD5); Thu, 07 Aug 2008 05:25:45 -0700 (PDT) To: internals@lists.php.net Date: Thu, 7 Aug 2008 14:24:04 +0200 User-Agent: KMail/1.10.0 (Linux/2.6.26-noch; KDE/4.1.0; i686; ; ) MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <200808071424.04620.arnaud.lb@gmail.com> Subject: PCRE and recursion: NO_RECURSE flag From: arnaud.lb@gmail.com (Arnaud Le Blanc) 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