From: i dot oppenheim at xs4all dot nl
Operating system: Linux 2.6.6-1um
PHP version: 4.3.9
PHP Bug Type: Reproducible crash
Bug description: preg_replace crashes on long strings
Description:
------------
preg_replace crashes on long strings.
My Configure Line:
./configure --prefix=/opt/php --with-apxs \
--with-mysql=/usr --with-zlib=/usr --with-png-dir=/usr\
--with-bz2 --with-t1lib --with-dom --with-ncurses\
--with-readline --enable-calendar --with-gd\
--with-freetype-dir --with-ttf --enable-gd-native-ttf\
--with-jpeg-dir --with-xpm-dir --with-tiff-dir=/usr\
--enable-exif --with-iconv --enable-sockets\
--with-db2 --enable-dba --with-openssl --disable-cgi
Reproduce code:
---------------
#!/usr/bin/env php
<?php
changeMsg ("http://www.sicodel.com/ct.txt") ;
function changeMsg ($file) {
$txt = file_get_contents ($file) ;
$txt = preg_replace (
"[Hosted by Shamash:(.|\n)*</pre>]",
"</pre>",
$txt
) ;
} # changeMsg
?>
Actual result:
--------------
Segmentation Fault!
--
Edit bug report at http://bugs.php.net/?id=30466&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30466&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30466&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30466&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30466&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30466&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30466&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30466&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30466&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30466&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30466&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30466&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30466&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30466&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30466&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30466&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30466&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30466&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30466&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30466&r=mysqlcfg