Mailing List Archive

#1747: VSL API: assertion failure "c->next.ptr < c->end" in vsl_cursor.c/vslc_vsm_next() in load tests
#1747: VSL API: assertion failure "c->next.ptr < c->end" in
vsl_cursor.c/vslc_vsm_next() in load tests
---------------------------------+------------------------
Reporter: geoff | Type: defect
Status: new | Priority: normal
Milestone: Varnish 4.0 release | Component: varnishlog
Version: 4.0.3 | Severity: normal
Keywords: |
---------------------------------+------------------------
This is more about the VSL API, since I've been getting the error from
three apps that use it. Two of them I made myself, and I'll take care of
those, but the other one is varnishlog, hence the ticket.

These all occurred during load tests, have not seen the problem except
under load.

{{{
(gdb) bt
#0 0x00007fe48f817625 in raise () from /lib64/libc.so.6
#1 0x00007fe48f818e05 in abort () from /lib64/libc.so.6
#2 0x00007fe49045681d in VAS_Fail_default (
func=0x7fe49047500e "vslc_vsm_next", file=0x7fe490474c7c
"vsl_cursor.c",
line=130, cond=0x7fe490474d19 "c->next.ptr < c->end", err=0,
kind=VAS_ASSERT) at ../libvarnish/vas.c:67
#3 0x00007fe4904602ed in vslc_vsm_next (cursor=0x1e6c648) at
vsl_cursor.c:130
#4 0x00007fe49046179a in VSL_Next (cursor=0x1e6c648) at vsl_cursor.c:470
#5 0x00007fe490467867 in vslq_next (vslq=0x1e6cc90) at
vsl_dispatch.c:1228
#6 0x00007fe490467d40 in VSLQ_Dispatch (vslq=0x1e6cc90,
func=0x4020f5 <vut_dispatch>, priv=0x0) at vsl_dispatch.c:1308
#7 0x00000000004030bb in VUT_Main () at
../../lib/libvarnishtools/vut.c:335
#8 0x000000000040207b in main (argc=11, argv=0x7fff2be25728)
at varnishlog.c:161
}}}

vsl_cursor.c at line 130 appears to be unchanged in the current trunk.

I have gdb prints of the contents of cursor->priv_data at the offending
frames, all of which look something like this:

{{{
(gdb) p *c
$1 = {magic = 1295582118, cursor = {rec = {ptr = 0x0, priv = 0},
priv_tbl = 0x7fe49067d240, priv_data = 0x1e6c640}, options = 3,
vsm = 0x1e6c200, vf = {chunk = 0x7fe46f6f57e0, b = 0x7fe46f6f5888,
e = 0x7fe48f6f5938, priv = 498506351, class = "Log\000\000\000\000",
type = "\000\000\000\000\000\000\000",
ident = '\000' <repeats 127 times>}, head = 0x7fe46f6f5888,
end = 0x7fe48f6f5938, segsize = 16777219, next = {ptr = 0x7fe48f6facec,
priv = 2098056490}}
}}}

I have backtraces and "p *c" from the other apps and coredumps which I can
add (but I suspect that they all tell the same story).

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1747>
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: #1747: VSL API: assertion failure "c->next.ptr < c->end" in vsl_cursor.c/vslc_vsm_next() in load tests [ In reply to ]
#1747: VSL API: assertion failure "c->next.ptr < c->end" in
vsl_cursor.c/vslc_vsm_next() in load tests
------------------------+----------------------------------
Reporter: geoff | Owner: slink
Type: defect | Status: new
Priority: normal | Milestone: Varnish 4.0 release
Component: varnishlog | Version: 4.0.3
Severity: normal | Resolution:
Keywords: |
------------------------+----------------------------------
Changes (by slink):

* owner: => slink


--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1747#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: #1747: VSL API: assertion failure "c->next.ptr < c->end" in vsl_cursor.c/vslc_vsm_next() in load tests [ In reply to ]
#1747: VSL API: assertion failure "c->next.ptr < c->end" in
vsl_cursor.c/vslc_vsm_next() in load tests
------------------------+----------------------------------
Reporter: geoff | Owner: slink
Type: defect | Status: closed
Priority: normal | Milestone: Varnish 4.0 release
Component: varnishlog | Version: 4.0.3
Severity: normal | Resolution: fixed
Keywords: |
------------------------+----------------------------------
Changes (by Nils Goroll <nils.goroll@…>):

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


Comment:

In [35cf78131c2aaaf8227c31ba92eb577c5bea9855]:
{{{
#!CommitTicketReference repository=""
revision="35cf78131c2aaaf8227c31ba92eb577c5bea9855"
Simplify vsl segment management, fixing spurious vsl overruns

vsl sequence and segment updates didn't happen atomically, so
vslc_vsm_check could report spurious overruns.

Replace sequence and segment index with a counter (segment_n), which
always increments (with overflow after UINT_MAX). The actual segment
index will be segment_n % VSL_SEGMENTS. Overrun detection by
calculation of the difference between two segment numbers becomes
simple and safe because we only ever access/update a single integer.

Update the shared memory log head.

(struct VSLC_ptr).priv is now the the equivalent of segment_n from the
reader side. It gets initialized once and is maintained independently.

Patch prepared in collaboration with Martin Blix Grydeland
<martin@varnish-software.com>

Fixes: #1747
}}}

--
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1747#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