[Varnish] #916: [PATCH] VCC assert error

Varnish varnish-bugs at varnish-cache.org
Mon May 16 02:42:06 CEST 2011


#916: [PATCH] VCC assert error
---------------------+------------------------------------------------------
 Reporter:  drwilco  |        Type:  defect  
   Status:  new      |    Priority:  normal  
Milestone:           |   Component:  varnishd
  Version:  trunk    |    Severity:  normal  
 Keywords:  VCC      |  
---------------------+------------------------------------------------------
 This VCL:

 {{{
 backend s1 {
     .host = "localhost";
     .port = "8080";
 }

 sub vcl_fetch {
     if (req.backend == s-1){
         set req.backend = s-1;
     }
 }
 }}}

 Gives the following error:

 {{{
 Message from VCC-compiler:
 Assert error in vcc_expr4(), vcc_expr.c line 674:
   Condition((sym->eval) != 0) not true.
 Running VCC-compiler failed, signal 6
 VCL compilation failed
 Command failed with error code 106
 }}}

 This is because VCC adds a symbol when it adds a reference, but the symbol
 does not get the eval field filled, like it should.

 The simple fix would probably be to add a check for sym->ndef == 0 and put
 an error out, but in the above VCL that would have the weird side effect
 of erroring on the second reference until it is fixed and then erroring on
 the first reference.

 Instead I fixed it by having vcc_AddRef use VCC_FindSymbol, instead of
 VCC_GetSymbolTok, and putting a nice error message in there. And calls to
 vcc_AddRef are now followed by ERRCHK or an assert if the error should not
 be possible.

 Patch: https://github.com/drwilco/varnish-
 cache/commit/9659fe48be9f8aafd82063601cbe5196c40fabe4

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




More information about the varnish-bugs mailing list