#41638 [Opn]: Stack overflow in pcre
| From: | hirainchen at gmail dot com | Date: | Fri, 08 Jun 2007 18:41:07 +0000 |
| Subject: | #41638 [Opn]: Stack overflow in pcre | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-113591@lists.php.net to get a copy of this message | ||
ID: 41638
User updated by: hirainchen at gmail dot com
Reported By: hirainchen at gmail dot com
Status: Open
Bug Type: PCRE related
Operating System: ALL
PHP Version: 5.2.3
New Comment:
had tried to set as 5000,1000,500 but not helpful
Previous Comments:
------------------------------------------------------------------------
[2007-06-08 18:34:03] stas@php.net
Looks like stack overflow to me. Happens also on Linux.
Try setting your limits lower.
------------------------------------------------------------------------
[2007-06-08 17:57:22] hirainchen at gmail dot com
Description:
------------
PCRE Library Version => 7.0 18-Dec-2006
this version PCRE seems doesn't work well with PHP.
I met same problem with php5.2.1+PCRE 7.0 in FreeBSD, resolved by
downgrading to PCRE 6.7(blog detail:
http://translate.google.com/translate?u=http%3A%2F%2Fhi.baidu.com%2Frainchen%2Fblog%2Fitem%2Fb6321038cf289bf3b211c7bf.html&langpair=zh%7Cen&hl=en&newwindow=1&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools)
I had tried to set php.ini as :
[Pcre]
pcre.backtrack_limit=100000
pcre.recursion_limit=100000
but not helping
Reproduce code:
---------------
<?php
$str = "repeater id='loopt' dataSrc=subject colums=2";
preg_match_all("/(['\"])((.*(\\\\\\1)*)*)\\1/sU",$str,$str_instead);
echo "<xmp>";
print_r($str_instead);
?>
Expected result:
----------------
<xmp>Array
(
[0] => Array
(
[0] => 'loopt'
)
[1] => Array
(
[0] => '
)
[2] => Array
(
[0] => loopt
)
[3] => Array
(
[0] => loopt
)
[4] => Array
(
[0] =>
)
)
Actual result:
--------------
<xmp>Array
(
[0] => Array
(
)
[1] => Array
(
)
[2] => Array
(
)
[3] => Array
(
)
[4] => Array
(
)
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41638&edit=1