Edit report at https://bugs.php.net/bug.php?id=61744&edit=1

 ID:                 61744
 User updated by:    bugzilla33 at gmail dot com
 Reported by:        bugzilla33 at gmail dot com
 Summary:            preg_match crashes
 Status:             Open
 Type:               Bug
 Package:            *Regular Expressions
 Operating System:   Win 7 64-bit
 PHP Version:        5.4.1RC2
 Block user comment: N
 Private report:     N

 New Comment:

str_repeat('AB',200) do not crash

str_repeat('AB',300) crashes - browser freeze about 4sec and info - browser can 
not display site


Previous Comments:
------------------------------------------------------------------------
[2012-04-16 16:18:15] ras...@php.net

Windows-only, I assume? Apache uses PCRE as well, so perhaps Apache on Windows 
is 
resetting the PCRE limits? I assume it doesn't crash if you reduce the 300 
there 
to something smaller?

------------------------------------------------------------------------
[2012-04-16 16:13:05] bugzilla33 at gmail dot com

I checked recursion-limit:
pcre.backtrack_limit 1000000
pcre.recursion_limit 100000

On fastCGI or direct php.exe testcase.php does not crash.

When use Apache 2.2.21 with php module with the same php.ini
testcase.php crash apache.

Now I am at home. The same crash like at work - two other machines.

------------------------------------------------------------------------
[2012-04-16 14:52:41] larue...@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

I think it is probable because of : 
http://www.php.net/manual/en/pcre.configuration.php#ini.pcre.recursion-limit

------------------------------------------------------------------------
[2012-04-16 11:01:26] bugzilla33 at gmail dot com

Try as Apache module.
php.exe testcase.php does not crash

------------------------------------------------------------------------
[2012-04-16 10:57:30] bugzilla33 at gmail dot com

Description:
------------
preg_match crashes

Test script:
---------------
<?=preg_match('#^(A{1,2}B)+$#',str_repeat('AB',300));?>

Expected result:
----------------
preg_match no crash

Actual result:
--------------
preg_match crashes


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=61744&edit=1

Reply via email to