ID:               49697
 Updated by:       [email protected]
 Reported By:      donquixote dot phplist at googlemail dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         Reproducible crash
 Operating System: Windows XP
 PHP Version:      5.2.11
 New Comment:

>From php.ini-dist:

[Pcre]
;PCRE library backtracking limit.
;pcre.backtrack_limit=100000

;PCRE library recursion limit. 
;Please note that if you set this value to a high number you may
consume all 
;the available process stack and eventually crash PHP (due to reaching
the 
;stack size limit imposed by the Operating System).
;pcre.recursion_limit=100000

So you should tune these to be such that it won't crash anymore.


Previous Comments:
------------------------------------------------------------------------

[2009-09-28 05:26:37] donquixote dot phplist at googlemail dot com

Description:
------------
I found a regex / text combination that causes my apache to crash /
restart with preg_replace. The example is a reduced version of Drupal's
CSS compression regex.

The regex is not overly complex, and the text is not overly long.

Reproducing this depends on system configuration: On my webspace it
does not crash.
But, on my localhost it always crashes with this regex / text
combination. Removing a few letters in the text (no matter which) makes
the bug not happen.

More info in the linked file.

So:
It seems that preg_replace is not the most robust piece of code. No
matter what you feed it, it should never ever crash!

And, btw:
I was going to report this as a comment on
http://bugs.php.net/bug.php?id=46551, but the comment form results in an
error page.
("Authentication failed: Incorrect username 
Warning: Cannot modify header information - headers already sent by
(output started at /home/Web/sites/php-bugs-web/include/auth.inc:30) in
/home/Web/sites/php-bugs-web/bug.php on line 232")

Reproduce code:
---------------
standalone script at
http://drupal.org/files/issues/test.php__1.txt

posted here
http://drupal.org/node/444228#comment-2089300

Expected result:
----------------
preg_replace should do its job (compressing the CSS).
Or show a meaningful error message, if there is a valid reason why this
is not possible.

Actual result:
--------------
Apache crash / restart, with no useful error message in error.log,
except the usual restart messages.


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


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

Reply via email to