Bug #51784 [NEW]: Segmentation fault! causes apache to crash.
| From: | notdefix at hotmail dot com | Date: | Mon, 10 May 2010 11:52:12 +0000 |
| Subject: | Bug #51784 [NEW]: Segmentation fault! causes apache to crash. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-150305@lists.php.net to get a copy of this message | ||
From:
Operating system:
PHP version: Irrelevant
Package: PCRE related
Bug Type: Bug
Bug description:Segmentation fault! causes apache to crash.
Description:
------------
Copied from: http://nl2.php.net/preg_replace
PHP version: Unknown
preg_replace (and str_replace too) will crash php if you use ' ' (space) as
replace value for a large number of matches.
following Apache Error-Log message:
[Mon May 10 09:23:58 2010] [notice] child pid 39251 exit signal Illegal
instruction (4)
where pid 39251 was the PHP-thread processing that request.
Test script:
---------------
Copied from: http://nl2.php.net/preg_replace
PHP version: Unknown
For example:
$string = preg_replace('/( )+/', ' ', $string);
$string = str_replace(' ', ' ', $string);
will crash if $string contains many seperate matches of ' ' producing
$string = preg_replace('/( )+/', '', $string);
$string = str_replace(' ', '', $string);
or
$string = preg_replace('/( )+/', '_', $string);
$string = str_replace(' ', '_', $string);
do all work fine.
This seems to be a bug in the underlying PCRE implementation, and not in
PHP itself.
--
Edit bug report at http://bugs.php.net/bug.php?id=51784&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51784&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51784&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51784&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=51784&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51784&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=51784&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=51784&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=51784&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=51784&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=51784&r=support
Expected behavior: http://bugs.php.net/fix.php?id=51784&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=51784&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=51784&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=51784&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51784&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51784&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=51784&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=51784&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=51784&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=51784&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=51784&r=mysqlcfg