Mailing List Archive

#1642: Assert error in VGZ_Ibuf()
#1642: Assert error in VGZ_Ibuf()
--------------------------+----------------------
Reporter: llavaud | Type: defect
Status: new | Priority: normal
Milestone: | Component: varnishd
Version: trunk | Severity: major
Keywords: assert error |
--------------------------+----------------------
{{{
Dec 1 16:59:01 webcache02 varnishd[31301]: Child (25643) Panic message:
Assert error in VGZ_Ibuf(), cache/cache_gzip.c line 161:
Condition((vg->vz.avail_in) == 0) not true.
errno = 104 (Connection reset by peer)
thread = (cache-worker)
version = varnish-trunk revision fb25963
ident = Linux,3.2.0-4-amd64,x86_64,-sfile,-smalloc,-hcritbit,epoll
Backtrace:
0x434424: pan_ic+0x134
0x426724: VGZ_Ibuf+0x74
0x427ceb: VDP_gunzip+0x13b
0x41a616: VDP_bytes+0x66
0x41be33: ESI_Deliver+0x293
0x41ac15: VDP_DeliverObj+0x135
0x44dc65: V1D_Deliver+0x275
0x437ea6: cnt_deliver+0x296
0x438489: CNT_Request+0x119
0x44f47b: HTTP1_Session+0x77b
req = 0x7fb4444de020 {
sp = 0x7fb4455942a0, vxid = 131327, step = R_STP_DELIVER,
req_body = R_BODY_NONE,
restarts = 0, esi_level = 0
sp = 0x7fb4455942a0 {
fd = 17, vxid = 131326,
client = 91.223.84.10 42579,
step = S_STP_WORKING,
},
worker = 0x7fb445c14c30 {
stack = {0x7fb445c15000 -> 0x7fb445c09000}
ws = 0x7fb445c14e40 {
id = "wrk",
{s,f,r,e} = {0x7fb445c14420,0x7fb445c14420,(nil),+2040},
},
VCL::method = DELIVER,
VCL::return = deliver,
VCL::methods = {RECV, PASS, HASH, MISS, HIT, DELIVER, BACKEND_FETCH,
BACKEND_RESPONSE},
},
ws = 0x7fb4444de1d0 {
id = "req",
{s,f,r,e} = {0x7fb4444dfff0,+5448,+253992,+253992},
},
http[req] = {
ws = 0x7fb4444de1d0[req]
"GET",
"/myuri",
"HTTP/1.1",
"User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0)
Gecko/20100101 Firefox/28.0",
"Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3",
"Referer: http://myhost/myuri",
"Connection: keep-alive",
"Via: 1.1 D7D03D48 (IWSS)",
"Host
}}}

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

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1642: Assert error in VGZ_Ibuf() [ In reply to ]
#1642: Assert error in VGZ_Ibuf()
--------------------------+--------------------
Reporter: llavaud | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: varnishd | Version: trunk
Severity: major | Resolution:
Keywords: assert error |
--------------------------+--------------------

Comment (by llavaud):

I have removed the following directive from my backend_response vcl:

{{{
if (beresp.http.Content-Type ~
"text/(html|plain|xml|css|javascript)|application/(x-javascript|javascript|ecmascript|rss\+xml|json|xml|xml\+rss)")
{
set beresp.do_gzip = true;
}
}}}

but the problem still occur

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

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1642: Assert error in VGZ_Ibuf() [ In reply to ]
#1642: Assert error in VGZ_Ibuf()
--------------------------+---------------------
Reporter: llavaud | Owner: martin
Type: defect | Status: new
Priority: normal | Milestone:
Component: varnishd | Version: trunk
Severity: major | Resolution:
Keywords: assert error |
--------------------------+---------------------
Changes (by martin):

* owner: => martin


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

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1642: Assert error in VGZ_Ibuf() [ In reply to ]
#1642: Assert error in VGZ_Ibuf()
--------------------------+---------------------
Reporter: llavaud | Owner: martin
Type: defect | Status: new
Priority: normal | Milestone:
Component: varnishd | Version: trunk
Severity: major | Resolution:
Keywords: assert error |
--------------------------+---------------------

Comment (by martin):

I have analyzed this ticket, and found the problem to stem from error
returns from VDP_bytes being ignored in ESI_Deliver() on lines 308, 350,
421 and 423. When gunzip is in effect this causes problems.

The problem starts in VDP_gunzip(). What happens is that when a VDP_bytes
call from lower in the stack returns error (e.g. write error when client
has gone away), the gunzip input buffer is left with bytes still present.
On the next call with more input data to this layer in the VDP, the
assertion is thrown because the buffer still has data in it. Normally this
doesn't cause problems, as the normal delivery path will abort the
delivery immediately upon VDP_bytes() returning error, and thus not call
VDP_bytes() again. But ESI_deliver() doesn't behave the same way.

Looking at ESI_deliver() the code is inconsistent with regards to the
treatment of VDP_bytes() errors. Some places it is dealt with, others it
isn't. The right behavior is an open question though. I see merit in
making ESI_deliver() ignore delivery errors so that the side effects of
delivery is applied (fetching uncached ESI includes). The right strategy
here needs to be decided.

Possible ways to solve this:
1)
Latch VDP_bytes errors as a status on req->vdp_error. Whenever VDP_bytes()
causes an error the flag is set, and all calls to VDP_bytes() when the
flag is set immediately returns error without descending into the VDP
stack. Also fix ESI_deliver() to always ignore VDP_bytes() errors to be
consistent and get the ESI include side effects applied.
2)
Fix ESI_deliver() to always check the return value from VDP_bytes().
3)
Change VDP_gunzip() to flush the input buffer on errors. Though I am
afraid that this would mask delivery errors as gunzip errors because we
then deliberately mess with the gzip stream.

Martin

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

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1642: Assert error in VGZ_Ibuf() [ In reply to ]
#1642: Assert error in VGZ_Ibuf()
--------------------------+---------------------
Reporter: llavaud | Owner: martin
Type: defect | Status: new
Priority: normal | Milestone:
Component: varnishd | Version: trunk
Severity: major | Resolution:
Keywords: assert error |
--------------------------+---------------------

Comment (by llavaud):

me i choose the quickest way ! ;)

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

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1642: Assert error in VGZ_Ibuf() [ In reply to ]
#1642: Assert error in VGZ_Ibuf()
--------------------------+---------------------
Reporter: llavaud | Owner: martin
Type: defect | Status: new
Priority: normal | Milestone:
Component: varnishd | Version: trunk
Severity: major | Resolution:
Keywords: assert error |
--------------------------+---------------------

Comment (by llavaud):

Hello,

Any news about this issue ?

I can't switch to varnish 4 due to this problem... :(

Regards.

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

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1642: Assert error in VGZ_Ibuf() [ In reply to ]
#1642: Assert error in VGZ_Ibuf()
--------------------------+---------------------
Reporter: llavaud | Owner: martin
Type: defect | Status: closed
Priority: normal | Milestone:
Component: varnishd | Version: trunk
Severity: major | Resolution: fixed
Keywords: assert error |
--------------------------+---------------------
Changes (by Poul-Henning Kamp <phk@…>):

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


Comment:

In [238705413c44c21c5ec91e890e34e1b0c1331066]:
{{{
#!CommitTicketReference repository=""
revision="238705413c44c21c5ec91e890e34e1b0c1331066"
Latch error values returned from any VDP function, making sure that
all subsequent calls to VDP_bytes() becomes noops. This allows calling
code to allow calling VDP_bytes() again even if a previous call
returned error.

Submitted by: Martin

Fixes #1642

PS: I have given up writing a test-case /phk
}}}

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

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs