Bug #62049 [Com]: A specific regex/input combo crashes PHP
Edit report at https://bugs.php.net/bug.php?id=62049&edit=1
ID: 62049
Comment by: arvids dot kokins at di dot lv
Reported by: arvids dot kokins at di dot lv
Summary: A specific regex/input combo crashes PHP
Status: Not a bug
Type: Bug
Package: PCRE related
Operating System: Windows
PHP Version: 5.4.3
Block user comment: N
Private report: N
New Comment:
Thanks, it did the trick.
I'm still slightly curious about the part that caused the stack overflow though --
but I guess I'll have to take it up with the developers of PCRE.
Previous Comments:
------------------------------------------------------------------------
[2012-05-16 21:30:15] pajoye@php.net
Increase the stack of the apache binaries or use the stack configuration option in
the apache configuration.
That's not something PHP can change. As you can see it works just fine in CLI (php
stack size is used there).
------------------------------------------------------------------------
[2012-05-16 21:00:44] arvids dot kokins at di dot lv
Another example: http://ideone.com/L29ib
If I remove the round brackets, the example works though: http://ideone.com/3ILgY
------------------------------------------------------------------------
[2012-05-16 20:34:07] arvids dot kokins at di dot lv
Looks like a warning is thrown with an internal error: http://codepad.org/FmlJi8N9
Some configurations need bigger input strings to trigger a crash, some react
differently...
Got HTTP error 101 (connection was reset) at home with the word "error" repeated
25 times.
------------------------------------------------------------------------
[2012-05-16 19:58:30] nulle at gmx dot com
Apache 2.2.9
PHP 5.3.1
Windows
Everything works fine.
------------------------------------------------------------------------
[2012-05-16 15:54:06] arvids dot kokins at di dot lv
Description:
------------
Test script crashes on web server (Apache 2.2.21) only with "empty response"
(324). Suspected to be a limit/overflow problem since it works if "errorerror" is
replaced with "error".
Test script:
---------------
<?php
echo preg_match( '/^<a(.)+class="(.)?actor-link(.)?"(.)+>Super
User<\/a>/', '<a class="actor-link"
href="/errorerror.lv/lv/jomsocial/42-super-user/profile">Super User</a> added 2
new photos in <a
href="/errorerror.lv/lv/jomsocial/42-super-user/photos/album?albumid=1">crap</a>
album' );
echo "\nFINISHED!";
?>
Expected result:
----------------
"1\nFINISHED"
Actual result:
--------------
HTTP error 324: empty response. Probably PHP crash. Apache didn't crash.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62049&edit=1
Thread (6 messages)