From: imacat at mail dot imacat dot idv dot tw Operating system: Debian 3.0r1/Linux 2.4.20 PHP version: 4.3.2 PHP Bug Type: PCRE related Bug description: segmentation fault in preg_match()
The following simple test script caused a segmentation fault: [EMAIL PROTECTED] ~ % cat test.php <?php $a = ""; for ($i = 0; $i < 10000; $i++) { $a .= "\x5F "; } preg_match("/(..)+(\x5Fa|\x5F@)/", $a); ?> [EMAIL PROTECTED] ~ % php test.php zsh: segmentation fault php test.php [EMAIL PROTECTED] ~ % No core dump. This piece of code was part of a complex regular expression to match against URLs in a piece of DBCS plain text. This is a most-simplified scratch that can illustrate the segmentation fault, so please don't ask me what this non-sense scratch is for. It first crashed under apache/mod_php4 4.3.1, and I found it crashes under php 4.3.2, too, both as apache/mod_php4 and php client binary. I have rewritten my subroutine to avoid this problem. It required rewriting anyway. This happens on my Debian 3.0r1x2 and Red Hat 9, all using gcc 3.3 and glibc 2.3.2. On my other 2 Red Hat 9, it enters an infinite loop and used up all the CPU time. Please tell me if you need more infomation on this. -- Edit bug report at http://bugs.php.net/?id=24008&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=24008&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=24008&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=24008&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=24008&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=24008&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=24008&r=support Expected behavior: http://bugs.php.net/fix.php?id=24008&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=24008&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=24008&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=24008&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24008&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=24008&r=dst IIS Stability: http://bugs.php.net/fix.php?id=24008&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=24008&r=gnused