stack ws workspace for pcre and others #1576

Nils Goroll slink at schokola.de
Tue Sep 2 22:08:20 CEST 2014



On 02/09/14 21:50, Nils Goroll wrote:
> On 02/09/14 21:45, Poul-Henning Kamp wrote:
>> What we really need is for pcre to tell us an estimate of how much
>> stack-space is needed during compilation
> 
> Is this possible? My understanding is that the recursion depth depends on the
> data and thus all we can do is set a recursion limit for the stack size we have
> available.

This sounds close to the answer we are looking for:

https://lists.exim.org/lurker/message/20130417.155604.5223f8b8.en.html


> Is there a way to get some "stats" for a regexp like max recursion
> depth, taken branches, steps needed for solution, ...?

The pcretest program has a facility for determining the max recursion
depth, given a pattern and a subject string. Grep for \M in the pcretest
man page.

pcretest(1):

 If \M is present, pcretest calls pcre_exec() several times, with different
values in the match_limit and match_limit_recursion fields of the pcre_extra
data structure, until it finds the minimum numbers for each parameter that allow
pcre_exec() to complete.




More information about the varnish-dev mailing list