Bug 109542 - preg_match_all with a particular regexp causes run-away php/apache process
Summary: preg_match_all with a particular regexp causes run-away php/apache process
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Alex Dupre
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-26 01:50 UTC by mark burdett
Modified: 2007-03-11 21:58 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.