Executing the provided code using PHP 5.4 produces a segmentation fault (core dumped). PHP v5.3 executes the code correctly. PHP v5.4 binary for Windows executes the code correctly. PHP v5.4 from ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8-stable/Latest/ or compiled from lang/php5 fails with a segmentation fault. This issue has been tested in FreeBSD 8.3-RELEASE and 9.1-RELEASE. gdb indicates that the issue is related to libpcre: Program terminated with signal 11, Segmentation fault. #0 0x0000000800d5ab5d in match () from /usr/local/lib/libpcre.so.3 How-To-Repeat: Create a file with the following php code and execute from the command line: # php -n ./test.php [php] $code = '<!--' . str_repeat('x', 5438) . '-->'; $result = preg_replace('/(<!--)(?!\s*(?:\[if [^\]]+]|<!|>))((?:(?!-->).)*[^\]])(-->)/is', '', $code); echo strlen($result); [/php] Expected result: 0 Actual result: Segmentation fault (core dumped) Note: Change the value of str_repeat from 5438 to 5437 and no segmentation fault occurs.
Responsible Changed From-To: freebsd-ports-bugs->ale Over to maintainer (via the GNATS Auto Assign Tool)
State Changed From-To: open->closed Unable to reproduce, probably you have to rebuild pcre.
State Changed From-To: closed->open Bug reproduced with pcretest and a 9999 'x's.
Responsible Changed From-To: ale->bf Bug reproduced with pcretest and a 9999 'x's.
Is this PR still relevant?
Maintainer reset.
Feedback timeout.