#49697 [NEW]: preg_replace crashes my system.
From: donquixote dot phplist at googlemail dot com
Operating system: Windows XP
PHP version: 5.2.11
PHP Bug Type: Reproducible crash
Bug description: preg_replace crashes my system.
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 bug report at http://bugs.php.net/?id=49697&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49697&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49697&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49697&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=49697&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49697&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=49697&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=49697&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=49697&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=49697&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=49697&r=support
Expected behavior: http://bugs.php.net/fix.php?id=49697&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=49697&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=49697&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=49697&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49697&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49697&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=49697&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=49697&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=49697&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=49697&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=49697&r=mysqlcfg
Thread (4 messages)
- donquixote dot phplist at googlemail dot com