#30466 [Opn->Fbk]: preg_replace crashes on long strings
| From: | derick@php.net | Date: | Mon, 18 Oct 2004 05:55:58 +0000 |
| Subject: | #30466 [Opn->Fbk]: preg_replace crashes on long strings | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-67711@lists.php.net to get a copy of this message | ||
ID: 30466
Updated by: derick@php.net
Reported By: i dot oppenheim at xs4all dot nl
-Status: Open
+Status: Feedback
Bug Type: Reproducible crash
Operating System: Linux 2.6.6-1um
PHP Version: 4.3.9
New Comment:
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php
Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2004-10-18 00:42:09] i dot oppenheim at xs4all dot nl
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 this bug report at http://bugs.php.net/?id=30466&edit=1