preg leak
| From: | Jason | Date: | Tue, 24 Aug 2004 12:28:59 +0000 |
| Subject: | preg leak | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-12321@lists.php.net to get a copy of this message | ||
Hi guys,
I'm looking for the maintainer of the preg_match
function in PHP. There appears to be a nasty leak in
its most basic functionality, and being a very
fundamental function of PHP (not to mention that my
long running scripts use it a lot ;) I thought I'd try
and go the direct route. Sorry, I don't know C or I'd
try to fix it myself! Considering its nature I
thought best to at least make a post to the list
rather than it get lost in the bugs pile (the original
(much less refined) report from someone else had been
sitting a long time).
<?
while (1) {
$body = "any string";
$rand = "any different
strings".mt_rand(0,mt_getrandmax());
$pattern = "/$rand/";
preg_match($pattern, $body, $match);
}
?>
http://bugs.php.net/bug.php?id=28513
This leaks 50MB per second on my PHP5.0.0,5.0.1. It
is probably the similar bug reported in PHP4. If you
have any suggestions, please let me know!
Sincere regards,
Jason.
_______________________________
Do you Yahoo!?
Win 1 of 4,000 free domain names from Yahoo! Enter now.
http://promotions.yahoo.com/goldrush