[Varnish] #878: Varnish child dies with segfault when loading a VCL importing std vmod

Varnish varnish-bugs at varnish-cache.org
Fri Mar 25 14:15:18 CET 2011


#878: Varnish child dies with segfault when loading a VCL importing std vmod
----------------------+-----------------------------------------------------
 Reporter:  tmagnien  |       Owner:  phk              
     Type:  defect    |      Status:  new              
 Priority:  normal    |   Milestone:                   
Component:  varnishd  |     Version:  trunk            
 Severity:  normal    |    Keywords:  std vmod segfault
----------------------+-----------------------------------------------------

Comment(by tmagnien):

 Here is the patch I would propose :


 {{{
 diff --git a/bin/varnishd/cache_vrt_vmod.c b/bin/varnishd/cache_vrt_vmod.c
 index 0c74e02..d61b1f4 100644
 --- a/bin/varnishd/cache_vrt_vmod.c
 +++ b/bin/varnishd/cache_vrt_vmod.c
 @@ -73,8 +73,12 @@ VRT_Vmod_Init(void **hdl, void *ptr, int len, const
 char *nm, const char *path)
         ASSERT_CLI();

         VTAILQ_FOREACH(v, &vmods, list)
 -               if (!strcmp(v->nm, nm))
 +               if (!strcmp(v->nm, nm)) {
 +                       AN(v->funcs);
 +                       AN(v->funclen);
 +                       memcpy(ptr, v->funcs, v->funclen);
                         break;
 +               }
         if (v == NULL) {
                 ALLOC_OBJ(v, VMOD_MAGIC);
                 AN(v);

 }}}

 Regards,[[BR]]

 Thierry

-- 
Ticket URL: <http://varnish-cache.org/trac/ticket/878#comment:3>
Varnish <http://varnish-cache.org/>
The Varnish HTTP Accelerator




More information about the varnish-bugs mailing list