[pcre-dev] [Bug 810] Segfault on pcregrep '(.)*' /dev/zero

Αρχική Σελίδα
Delete this message
Συντάκτης: Philip Hazel
Ημερομηνία:  
Προς: pcre-dev
Αντικείμενο: [pcre-dev] [Bug 810] Segfault on pcregrep '(.)*' /dev/zero
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=810

Philip Hazel <ph10@???> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID





--- Comment #1 from Philip Hazel <ph10@???> 2009-02-16 17:12:36 ---
(In reply to comment #0)

> I was bitten by a more complicated case of this problem on real files. The
> crash can be avoided by configuring pcre with --disable-stack-for-recursion,
> but I am surprised that such an apparently simple test case leads to infinite
> recursion.


I am surprised that you are surprised. Every time the (.) repeats, there is a
new level of processing; it has to remember where it was before in case the new
level fails and it has to back up. Therefore, it uses memory each time. Since
there is an infinite supply of data from /dev/zero, it will eventually run out
of memory. There is nothing that can be done about this. If you use
--disable-stack-for-recursion it will still eventually run out of memory; it
just depends on the size of your stack vs the size of your heap.


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email