Bug 109542

Summary: preg_match_all with a particular regexp causes run-away php/apache process
Product: Ports & Packages Reporter: mark burdett <mfburdett>
Component: Individual Port(s)Assignee: Alex Dupre <ale>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description mark burdett 2007-02-26 01:50:05 UTC
preg_match_all() with a particular regexp causes a run-away Apache/PHP
process which consumes all available CPU.  This is on amd64
architecture; FreeBSD 6.2; PCRE 7.0 and PHP 5.2.1 installed through ports.

Also posted here: http://bugs.php.net/bug.php?id=40630

How-To-Repeat: Reproduce code:
---------------
<?php 
$regexp = '%(?:^|,\ *)("(?>[^"]*)(?>""[^"]* )*"|(?: [^",]*))%x'; 
preg_match_all($regexp, $string, $matches); 

Expected result:
----------------
It should compile and execute.

Actual result:
--------------
Process consumes all available CPU until killed.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2007-02-26 06:18:05 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ale

Over to maintainer
Comment 2 mark burdett 2007-02-26 20:41:09 UTC
This seems to be fixed in the latest PHP 5.2 snapshot.  I can only
reproduce on amd64.
Comment 3 Alex Dupre freebsd_committer freebsd_triage 2007-03-11 21:57:40 UTC
State Changed
From-To: open->closed

Should be fixed in cvs.