Edit report at https://bugs.php.net/bug.php?id=60419&edit=1
ID: 60419
Comment by: mikemc-phpbug at terabytemedia dot com
Reported by: mikemc-phpbug at terabytemedia dot com
Summary: PCRE segfault
Status: Open
Type: Bug
Package: PCRE related
Operating System: linux
PHP Version: 5.3.8
Block user comment: N
Private report: N
New Comment:
Removing the "\s?" from the pattern alleviates the issue (no crashing), but of
course, then the pattern does not serve a purpose for me.
Previous Comments:
------------------------------------------------------------------------
[2011-11-30 16:23:21] mikemc-phpbug at terabytemedia dot com
Description:
------------
Tested this on my custom built 5.3.8 and the standard 5.3.8 that ships with FC
15 - same result in both so I assume it is not specific to my build. Run the
test code - it will segfault. Not sure if this is PHP related (PHP hooks into
PCRE) or solely lives inside PCRE.
Test script:
---------------
<?php
$input = "
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
.................................................................................................................................................................................................
";
echo preg_replace('/(\.\s?){3,}/', '...', $input);
Expected result:
----------------
Not to dump core
Actual result:
--------------
Dumped core
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60419&edit=1