#36507 [Opn->Fbk]: Crash in preg_replace
| From: | tony2001@php.net | Date: | Fri, 24 Feb 2006 08:26:25 +0000 |
| Subject: | #36507 [Opn->Fbk]: Crash in preg_replace | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-93606@lists.php.net to get a copy of this message | ||
ID: 36507
Updated by: tony2001@php.net
Reported By: joc at presence-pc dot com
-Status: Open
+Status: Feedback
Bug Type: Reproducible crash
Operating System: Linux
PHP Version: 4.4.2
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
for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php
for Win32
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:
------------------------------------------------------------------------
[2006-02-24 09:24:39] joc at presence-pc dot com
Description:
------------
Hi,
PHP segfaults during a call to preg_replace.
If in the code below
preg_replace('/(\s|^)(\.)+/',' ',$source);
is replaced by
preg_replace('/(\s|^)\.+/',' ',$source);
The crash doesn't occurs anymore.
Regards,
Jocelyn
Reproduce code:
---------------
<?$source= "
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..............................................................................................................................................................................................................................................
..........................................................................................................................................................................
";
preg_replace('/(\s|^)(\.)+/',' ',$source);
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36507&edit=1