Edit report at http://bugs.php.net/bug.php?id=53635&edit=1
ID: 53635 User updated by: simon at simon dot geek dot nz Reported by: simon at simon dot geek dot nz Summary: Long strings causes PCRE to seg fault Status: Open Type: Bug Package: PCRE related Operating System: Mac OS 10.6.5 PHP Version: 5.3SVN-2011-01-01 (SVN) Block user comment: N Private report: N New Comment: If needed, I can upload a script with a much longer string. Previous Comments: ------------------------------------------------------------------------ [2011-01-01 02:18:19] simon at simon dot geek dot nz Description: ------------ Given certain regexs and large strings, preg_match() will recurse around 9200 times and then seg fault. The shortest length for the string to match that I managed to get that reproduce the crash each time was 4596 characters. Different versions of the PCRE library can handle longer strings, but all versions I tested crashed at 7000. I ran this solely through the CLI. The configure command I used was: ./configure --without-pear "--prefix=$PWD" -- enable-debug for both SVN revision 306937 and PHP 5.3.4. The version of PHP (5.3.3) that is included in Mac OS 10.6.5 and is linked against external PCRE libraries also seg faulted. The regex I was using is #^"((\\"|[^"])+)#. Removing \\"| prevents the seg fault from occurring. Test script: --------------- http://simon.geek.nz/assets/text/a Expected result: ---------------- Either a 0 or a 1 to be returned. Actual result: -------------- PHP segfaulted with a rather large (6.1 MB) backtrace. http://simon.geek.nz/assets/text/9 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53635&edit=1
