ID:               27525
 Updated by:       [EMAIL PROTECTED]
 Reported By:      valvatne at pvv dot org
-Status:           Open
+Status:           Bogus
 Bug Type:         Reproducible crash
 Operating System: RedHat Linux 9 - Kernel 2.4.20-8
 PHP Version:      4CVS-2004-03-08 (stable)
 New Comment:

This is a PCRE limitation, as your pattern creates to many recursive
lookups. There is nothing we can do here for you.


Previous Comments:
------------------------------------------------------------------------

[2004-03-08 03:08:46] valvatne at pvv dot org

Description:
------------
PHP segfaults when running preg_match() with a simple pattern intended
to match any sequence of characters which are not followed by a given
character (lookahead assertion). The segfault only happens if the
string being matched approaches 10k characters in length, but at that
point it seems to be 100% reproducible.



Config line:

./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql
--with-pgsql --enable-sockets --enable-debug

Reproduce code:
---------------
$strlen = 10000;

$string = '';

for($i=0;$i<$strlen;$i++) {

    $string .= "a";

}

$pattern = '/(.(?!b))*/';

echo preg_match($pattern, $string);

Expected result:
----------------
1

Actual result:
--------------
Segmentation fault. I can't seem to get gdb to behave right now, so if
someone else could reproduce the bug and post a backtrace, that would
be nice.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=27525&edit=1

Reply via email to