ID:               28317
 Updated by:       [EMAIL PROTECTED]
 Reported By:      novicky at aarongroup dot cz
-Status:           Assigned
+Status:           Closed
 Bug Type:         PCRE related
 Operating System: win32
 PHP Version:      4.3.6
 Assigned To:      edink
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




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

[2004-05-07 18:47:02] novicky at aarongroup dot cz

Description:
------------
Stack overflow during preg_match() on complex regular expressions used
for long data.

As written in pcre.c ...

/***************************************************************************
****************************************************************************
                   RECURSION IN THE match() FUNCTION

The match() function is highly recursive. Some regular expressions can
cause
it to recurse thousands of times. I was writing for Unix, so I just let
it
call itself recursively. This uses the stack for saving everything that
has
to be saved for a recursive call. On Unix, the stack can be large, and
this
works fine.

It turns out that on non-Unix systems there are problems with programs
that
use a lot of stack. (This despite the fact that every last chip has
oodles
of memory these days, and techniques for extending the stack have been
known
for decades.) So....

There is a fudge, triggered by defining NO_RECURSE, which avoids
recursive
calls by keeping local variables that need to be preserved in blocks of
memory
obtained from malloc instead instead of on the stack. Macros are used
to
achieve this so that the actual code doesn't look very different to
what it
always used to.
****************************************************************************
***************************************************************************/

Thus NO_RECURSE should be set in win32 compiler oprions.



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


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

Reply via email to