#39934 [NEW]: pcre simple segfault ?
| From: | toggg@php.net | Date: | Fri, 22 Dec 2006 20:35:41 +0000 |
| Subject: | #39934 [NEW]: pcre simple segfault ? | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-106806@lists.php.net to get a copy of this message | ||
From: toggg@php.net
Operating system: Irrelevant
PHP version: 4.4.4
PHP Bug Type: PCRE related
Bug description: pcre simple segfault ?
Description:
------------
It is a reduction of http://pear.php.net/bugs/bug.php?id=7908
This test is breaking by repeat=437 by php-4.4.4 Windows NT and 10000 by
php 5.1.6 linux FC5
It's not breaking if you give ok=1 or nomatch=1 or reduce enough repeat.
Note: it's php version irrelevent , but your sytem forced to choose some.
Reproduce code:
---------------
<?php
error_reporting(E_ALL);
ini_set('display_errors', true);
function process($matches)
{
return $matches[0];
}
$regex = isset($_GET['ok']) ? '#X(.*?)X#' : '#X((.)*?)X#';
$around = isset($_GET['nomatch']) ? 'Y' : 'X';
$repeat = isset($_GET['repeat']) ? (int) $_GET['repeat'] : 10000;
$source = $around . str_repeat('a', $repeat) . $around;
$transform = preg_replace_callback($regex, 'process', $source);
echo '---Text---' . strlen($source) . "\n";
echo "---Transform---" . strlen($transform) . "\n";
?>
--
Edit bug report at http://bugs.php.net/?id=39934&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39934&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39934&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39934&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=39934&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=39934&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=39934&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=39934&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=39934&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=39934&r=support
Expected behavior: http://bugs.php.net/fix.php?id=39934&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=39934&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=39934&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=39934&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39934&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=39934&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=39934&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=39934&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=39934&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=39934&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=39934&r=mysqlcfg