[Varnish] #1576: default pcre_match_limit_recursion and thread_pool_stack dont match - varnishd child process crashes with segfault error 6 in libpcre.so.3.13.1

Varnish varnish-bugs at varnish-cache.org
Mon Sep 22 18:40:44 CEST 2014


#1576: default pcre_match_limit_recursion and thread_pool_stack dont match -
varnishd child process crashes with segfault error 6 in libpcre.so.3.13.1
----------------------+--------------------
 Reporter:  abdi      |       Owner:  phk
     Type:  defect    |      Status:  new
 Priority:  normal    |   Milestone:
Component:  varnishd  |     Version:  4.0.1
 Severity:  normal    |  Resolution:
 Keywords:            |
----------------------+--------------------

Comment (by slink):

 phk, your jit results match pcrejit(3):

 > (jit) uses 32K on the machine stack. However, some large or complicated
 patterns need more than this.

 For the case without jit, I wonder how you determined the significant
 stack memory requirement. I ran this simple check:

 {{{
 $ ./pcretest -m -M
 PCRE version 8.36-RC1 2014-04-21

   re> "(\w)(?:(?R)|\w?)\1"
 Memory allocation (code space): 33
 data> tattarrattat
 Minimum match() limit = 55
 Minimum match() recursion limit = 38
  0: tattarrattat
  1: t
 }}}

 * when `pcretest` presented the prompt:

 {{{
 slink at haggis:~$ pmap -x $(pgrep pcretest) | grep stack
 00007fffd2227000     132      12      12 rw---   [ stack ]
 }}}

 * after matching tattarrattat

 {{{
 slink at haggis:~$ pmap -x $(pgrep pcretest) | grep stack
 00007fffd2227000     132      36      36 rw---   [ stack ]
 }}}

 So the 38 recursions have used ~700 bytes each

-- 
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1576#comment:15>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator



More information about the varnish-bugs mailing list