ID: 36507
User updated by: joc at presence-pc dot com
Reported By: joc at presence-pc dot com
-Status: Feedback
+Status: Open
Bug Type: Reproducible crash
Operating System: Linux
PHP Version: 4.4.2
New Comment:
Hi,
Here is the backtrace :
#0 0x08072ff9 in match (eptr=0x8360dfd '.' <repeats 200 times>...,
ecode=0x835c146 "R", offset_top=6, md=0xbfffd210, ims=0,
eptrb=0xbf8004d8, flags=2)
at /usr/src/php-4.4.2/ext/pcre/pcrelib/pcre_exec.c:517
517 utf8 = md->utf8; /* Local copy of the flag */
(gdb) bt
#0 0x08072ff9 in match (eptr=0x8360dfd '.' <repeats 200 times>...,
ecode=0x835c146 "R", offset_top=6, md=0xbfffd210, ims=0,
eptrb=0xbf8004d8, flags=2)
at /usr/src/php-4.4.2/ext/pcre/pcrelib/pcre_exec.c:517
#1 0x080741a9 in match (eptr=0x8360dfd '.' <repeats 200 times>...,
ecode=0x835c14b "C", offset_top=6, md=0xbfffd210, ims=0,
eptrb=0xbf8004d8, flags=2)
at /usr/src/php-4.4.2/ext/pcre/pcrelib/pcre_exec.c:1123
#2 0x0807317b in match (eptr=0x8360dfc '.' <repeats 200 times>...,
ecode=0x835c146 "R", offset_top=6, md=0xbfffd210, ims=0,
eptrb=0xbf8004d8, flags=2)
at /usr/src/php-4.4.2/ext/pcre/pcrelib/pcre_exec.c:589
#3 0x080741a9 in match (eptr=0x8360dfc '.' <repeats 200 times>...,
ecode=0x835c14b "C", offset_top=6, md=0xbfffd210, ims=0,
eptrb=0xbf800958, flags=2)
at /usr/src/php-4.4.2/ext/pcre/pcrelib/pcre_exec.c:1123
#4 0x0807317b in match (eptr=0x8360dfb '.' <repeats 200 times>...,
ecode=0x835c146 "R", offset_top=6, md=0xbfffd210, ims=0,
eptrb=0xbf800958, flags=2)
at /usr/src/php-4.4.2/ext/pcre/pcrelib/pcre_exec.c:589
[...]
Regards,
Jocelyn
Previous Comments:
------------------------------------------------------------------------
[2006-02-24 09:26:23] [EMAIL PROTECTED]
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.
------------------------------------------------------------------------
[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