[Varnish] #1671: VRT_re_match causes Segmentation fault in libpcre.so.3

Varnish varnish-bugs at varnish-cache.org
Wed Feb 4 15:00:03 CET 2015


#1671: VRT_re_match causes  Segmentation fault in libpcre.so.3
---------------------------+----------------------
 Reporter:  lygie          |       Type:  defect
   Status:  new            |   Priority:  normal
Milestone:                 |  Component:  varnishd
  Version:  4.0.2          |   Severity:  normal
 Keywords:  sefgault, vcl  |
---------------------------+----------------------
 Hi,

 we are using VCL code generated from

 https://github.com/willemk/varnish-mobiletranslate

 to set a Device-Type header in varnish.

 The generated VCL-Code is here:
 https://github.com/willemk/varnish-
 mobiletranslate/blob/master/mobile_detect.vcl

 The code workes perfectly with varnish3.
 On varnish4 when a user-agent
 {{{
 "Mozilla/5.0 (Linux; Android 5.0.1; Nexus 5 Build/LRX22C)
 AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.89 Mobile
 Safari/537.36"
 }}}
 hits the varnish, it crashes with a segfault.

 Here is the gdb backtrace from the coredump:
 {{{
 Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
 Core was generated by `/usr/sbin/varnishd -P /var/run/varnishd.pid -a :80
 -T localhost:6082 -f /opt/cd'.
 Program terminated with signal SIGSEGV, Segmentation fault.
 #0  0x00007f98a25b354a in ?? () from /lib/x86_64-linux-gnu/libpcre.so.3
 (gdb) bt
 #0  0x00007f98a25b354a in ?? () from /lib/x86_64-linux-gnu/libpcre.so.3
 #1  0x00007f98a25b3ecb in ?? () from /lib/x86_64-linux-gnu/libpcre.so.3
 #2  0x00007f98a25c0cfa in ?? () from /lib/x86_64-linux-gnu/libpcre.so.3

 ...
 #73 0x00007f98a25bbb59 in ?? () from /lib/x86_64-linux-gnu/libpcre.so.3
 #74 0x00007f98a25c4221 in pcre_exec () from /lib/x86_64-linux-
 gnu/libpcre.so.3
 #75 0x00007f98a2e4f8be in VRE_exec () from /usr/lib/varnish/libvarnish.so
 #76 0x00000000004430d2 in VRT_re_match ()
 #77 0x00007f9896ca8064 in VGC_function_devicedetect
 (ctx=ctx at entry=0x7f989288d160) at ./vcl.ZG6nwvTJ.c:1045
 #78 0x00007f9896ca9bd5 in VGC_function_vcl_recv (ctx=0x7f989288d160) at
 ./vcl.ZG6nwvTJ.c:1298
 #79 0x000000000043fcf6 in ?? ()
 #80 0x00000000004401c5 in VCL_recv_method ()
 #81 0x0000000000437a71 in CNT_Request ()
 #82 0x000000000042d17b in HTTP1_Session ()
 #83 0x000000000043b738 in ?? ()
 #84 0x0000000000436033 in Pool_Work_Thread ()
 #85 0x00000000004492f8 in ?? ()
 #86 0x00007f98a1e80182 in start_thread (arg=0x7f989288e700) at
 pthread_create.c:312
 #87 0x00007f98a1bad00d in clone () at
 ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
 }}}

 Line 1045 from vcl.ZG6nwvTJ.c mentioned in the coredump is:

 (VRT_re_match(ctx, VRT_GetHdr(ctx, &VGC_HDR_REQ_User_Agent), VGC_re_53))||

 The operating system is ubuntu 14.04 64 bit using varnish apt repository:
 https://repo.varnish-cache.org/ubuntu/ precise varnish-4.0

-- 
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1671>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator



More information about the varnish-bugs mailing list