Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Varnish: Bugs

#1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data

 

 

Varnish bugs RSS feed   Index | Next | Previous | View Threaded


varnish-bugs at varnish-cache

Jan 22, 2012, 8:30 AM

Post #1 of 15 (835 views)
Permalink
#1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data

#1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data
----------------------+-----------------------------------------------------
Reporter: martin | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: varnishd | Version: 3.0.0
Severity: normal | Keywords:
----------------------+-----------------------------------------------------
If VGZ_WrwGunzip is called again with junk data after end of gzip data, it
will loop forever. Note that this does not happen if the junk data is part
of the same input data buffer that contained the of gzip data, but it only
happens on successive calls to VGZ_WrwGunzip and VGZ_Guzip has seen the
end of gzip data.

This has an increased probability of happening when doing streaming. See
attached test case.

Bug has been confirmed in both 3.0 and master.

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

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


varnish-bugs at varnish-cache

Jan 23, 2012, 3:07 AM

Post #2 of 15 (804 views)
Permalink
Re: #1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data [In reply to]

#1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data
----------------------+-----------------------------------------------------
Reporter: martin | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: varnishd | Version: 3.0.2
Severity: normal | Keywords:
----------------------+-----------------------------------------------------
Changes (by martin):

* version: 3.0.0 => 3.0.2


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

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


varnish-bugs at varnish-cache

Apr 23, 2012, 9:27 AM

Post #3 of 15 (772 views)
Permalink
Re: #1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data [In reply to]

#1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data
----------------------+-----------------------------------------------------
Reporter: martin | Owner:
Type: defect | Status: closed
Priority: normal | Milestone:
Component: varnishd | Version: 3.0.2
Severity: normal | Resolution: fixed
Keywords: |
----------------------+-----------------------------------------------------
Changes (by phk):

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


Comment:

I just checked, this is fixed in -trunk

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

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


varnish-bugs at varnish-cache

Jan 12, 2013, 1:40 AM

Post #4 of 15 (704 views)
Permalink
Re: #1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data [In reply to]

#1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data
----------------------+---------------------
Reporter: martin | Owner:
Type: defect | Status: closed
Priority: normal | Milestone:
Component: varnishd | Version: 3.0.2
Severity: normal | Resolution: fixed
Keywords: |
----------------------+---------------------

Comment (by LordCope):

I'm seeing behaviour very much in keeping with this issue. Running on
3.0.3 using the Varnish package for Ubuntu, if I run the test case
attached by "martin", it fails.

See attached log of varnishtest.

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

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


varnish-bugs at varnish-cache

Jan 12, 2013, 2:00 AM

Post #5 of 15 (696 views)
Permalink
Re: #1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data [In reply to]

#1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data
----------------------+-----------------------
Reporter: martin | Owner:
Type: defect | Status: reopened
Priority: normal | Milestone:
Component: varnishd | Version: 3.0.2
Severity: normal | Resolution:
Keywords: |
----------------------+-----------------------
Changes (by LordCope):

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


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

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


varnish-bugs at varnish-cache

Jan 12, 2013, 2:03 AM

Post #6 of 15 (694 views)
Permalink
Re: #1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data [In reply to]

#1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data
----------------------+-----------------------
Reporter: martin | Owner:
Type: defect | Status: reopened
Priority: normal | Milestone:
Component: varnishd | Version: 3.0.2
Severity: normal | Resolution:
Keywords: |
----------------------+-----------------------

Comment (by LordCope):

Also, although it claims to be fixed, I don't see any relevant commit
logs, or anything in either changelog or the current src which references.
Perhaps when checked by 'phk' the reason for the test passing was
incidental - ie something could have subsequently changed which makes this
issue happen again?

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

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


varnish-bugs at varnish-cache

Jan 12, 2013, 6:39 AM

Post #7 of 15 (693 views)
Permalink
Re: #1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data [In reply to]

#1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data
----------------------+-----------------------
Reporter: martin | Owner:
Type: defect | Status: reopened
Priority: normal | Milestone:
Component: varnishd | Version: 3.0.2
Severity: normal | Resolution:
Keywords: |
----------------------+-----------------------

Comment (by LordCope):

Built the current git master of 3.0. Changed debug paramater to
debug=+syncvsl, and ran the test.

Failure attached.

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

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


varnish-bugs at varnish-cache

Jan 14, 2013, 3:42 AM

Post #8 of 15 (685 views)
Permalink
Re: #1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data [In reply to]

#1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data
----------------------+---------------------
Reporter: martin | Owner: martin
Type: defect | Status: new
Priority: normal | Milestone:
Component: varnishd | Version: 3.0.2
Severity: normal | Resolution:
Keywords: |
----------------------+---------------------
Changes (by martin):

* status: reopened => new
* owner: => martin


Comment:

Not applicable to trunk. I will have a look to see if this is a real
problem on 3.0. Bear in mind that the test case attached here might not be
very indicative, as testing on close conditions and streaming is not
trivial.

Martin

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

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


varnish-bugs at varnish-cache

Jan 14, 2013, 3:53 AM

Post #9 of 15 (690 views)
Permalink
Re: #1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data [In reply to]

#1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data
----------------------+---------------------
Reporter: martin | Owner: martin
Type: defect | Status: new
Priority: normal | Milestone:
Component: varnishd | Version: 3.0.2
Severity: normal | Resolution:
Keywords: |
----------------------+---------------------

Comment (by martin):

Note to self: Look at this with e6e34d24b7b2e47d936867a4a1d7714ca568b7ae
in mind

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

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


varnish-bugs at varnish-cache

Feb 13, 2013, 2:00 AM

Post #10 of 15 (670 views)
Permalink
Re: #1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data [In reply to]

#1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data
----------------------+---------------------
Reporter: martin | Owner: martin
Type: defect | Status: new
Priority: normal | Milestone:
Component: varnishd | Version: 3.0.2
Severity: normal | Resolution:
Keywords: |
----------------------+---------------------

Comment (by dstuart):

Hi, Is there any update on this.

Regards,

Dave

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

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


varnish-bugs at varnish-cache

Jul 2, 2013, 8:55 PM

Post #11 of 15 (574 views)
Permalink
Re: #1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data [In reply to]

#1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data
----------------------+---------------------
Reporter: martin | Owner: martin
Type: defect | Status: new
Priority: normal | Milestone:
Component: varnishd | Version: 3.0.2
Severity: normal | Resolution:
Keywords: |
----------------------+---------------------

Comment (by lgx):

3.0.3 has the same problem.

The reason is, VGZ_WrwGunzip dones't process the return code VGZ_END of
VGZ_Gunzip.
So it will loop forever at this situation.

I think the fix would be:
if (i < VGZ_OK) {
/* XXX: VSL ? */
return (-1);
}
+ else if(i == VGZ_END)
+ {
+ break;
+ }

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

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


varnish-bugs at varnish-cache

Aug 27, 2013, 1:50 PM

Post #12 of 15 (492 views)
Permalink
Re: #1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data [In reply to]

#1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data
----------------------+---------------------
Reporter: martin | Owner: martin
Type: defect | Status: new
Priority: normal | Milestone:
Component: varnishd | Version: 3.0.2
Severity: normal | Resolution:
Keywords: |
----------------------+---------------------

Comment (by nnewton):

I don't have much to add here, but wanted to note that I've also recently
hit this with a cluster of 3 varnish 3.0.3 servers. It was pretty much
identical to the above situations:
* Varnish would run for about an hour and then one thread would take 100%
of a single core, if you left it eventually another thread would as well.
* If you pull the stack of these threads they are clearly looping through
the gunzip process.
* These events happened around incomplete transfers from the backend it
would seem.
* They were all on ESI-ed paths, thus forcing varnish to attempt to
gunzip the object from the backend.

We resolved the issue be editing the VCL to request un-gzipped objects
from the backend on ESI-ed paths. This has solved the issue for us.

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

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


varnish-bugs at varnish-cache

Jan 3, 2014, 3:23 AM

Post #13 of 15 (287 views)
Permalink
Re: #1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data [In reply to]

#1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data
----------------------+---------------------
Reporter: martin | Owner: martin
Type: defect | Status: new
Priority: normal | Milestone:
Component: varnishd | Version: 3.0.2
Severity: normal | Resolution:
Keywords: |
----------------------+---------------------

Comment (by phk):

This seems still unfixed in 3.0.5

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

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


varnish-bugs at varnish-cache

Jan 3, 2014, 6:08 AM

Post #14 of 15 (287 views)
Permalink
Re: #1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data [In reply to]

#1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data
----------------------+---------------------
Reporter: martin | Owner: martin
Type: defect | Status: new
Priority: normal | Milestone:
Component: varnishd | Version: 3.0.2
Severity: normal | Resolution:
Keywords: |
----------------------+---------------------

Comment (by lkarsten):

Went digging in this a bit today.

The VGZ_END patch ignores the possibility that there are multiple gzip
streams concatenated in an object. I wouldn't be surprised if there are
backends that end up doing this, perhaps after getting a flush() or
similar. This is speculation, but debugging partial/incomplete responses
to non-gzip-clients sometime down the road sounds painful.

I guess the main point is to avoid a spinning thread.

If we stop after a VGZ_END, we'll get that but may serve incomplete
objects. We can also make up some magic number of rounds this loop maximum
should take before aborting, but that isn't very pretty. Another way might
be to look into the next data chunk after VGZ_END and see if it is a gzip
header (continue) or not (close connection).

What is the correct behaviour here?

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

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


varnish-bugs at varnish-cache

Jan 27, 2014, 3:53 AM

Post #15 of 15 (227 views)
Permalink
Re: #1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data [In reply to]

#1086: VGZ_WrwGunzip loops forever if receiving junk data after end of gzip data
----------------------+---------------------
Reporter: martin | Owner: martin
Type: defect | Status: closed
Priority: normal | Milestone:
Component: varnishd | Version: 3.0.2
Severity: normal | Resolution: fixed
Keywords: |
----------------------+---------------------
Changes (by Lasse Karstensen <lkarsten@…>):

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


Comment:

In [4ae3ffc3ab7cd358fa626caf3a9fab55f3bda22d]:
{{{
#!CommitTicketReference repository=""
revision="4ae3ffc3ab7cd358fa626caf3a9fab55f3bda22d"
Stop handling after gzip object end.

Junk after gzip body end would lead to a spinning
thread.

Fixes: #1086
}}}

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

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

Varnish bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.