[Varnish] #1031: error 200 "long string" overflows obj.ws effectively unsetting obj.response which subsequently causes Bad Things

Varnish varnish-bugs at varnish-cache.org
Mon Oct 17 13:35:42 CEST 2011


#1031: error 200 "long string" overflows obj.ws effectively unsetting obj.response
which subsequently causes Bad Things
----------------------+-----------------------------------------------------
 Reporter:  kristian  |        Owner:        
     Type:  defect    |       Status:  closed
 Priority:  normal    |    Milestone:        
Component:  varnishd  |      Version:  trunk 
 Severity:  normal    |   Resolution:  fixed 
 Keywords:            |  
----------------------+-----------------------------------------------------
Changes (by Kristian Lyngstol <kristian@…>):

  * status:  new => closed
  * resolution:  => fixed


Comment:

 (In [601ee74203b8d0088251c43c5e5de380dabdcba0]) Ensure obj->response is
 set sensibly for errors

 The http_PutProtocol() and http_PutResponse() would in the case of
 workspace overflow leave the headers as NULL and log a
 SLT_LostHeader. This would make Varnish assert correctly later when
 writing to the wire, as these are mandated by HTTP.

 This commit changes them to set the fields to static strings instead
 ("HTTP/1.1" and "Lost Response") when failing to write them to the
 workspace. This leaves enough information to complete the protocol in the
 case of overflow.

 The patch also increases the synthetic object's workspace from static
 1024 to param->http_resp_size. This leaves more (and configurable)
 room for manipulating the headers of the synthetic object in
 vcl_error.

 This whole thing has been a collaboration between Martin and myself. I'll
 leave it a mystery who wrote what line of code, which part of the comment
 and contributed what to the test-case.

 In all fairness, it's not a prefect solution, but a far step closer to
 one.
 So it sort of, kinda, more or less, for now, until we get a better
 solution:

 Fixes: #1031

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




More information about the varnish-bugs mailing list