[master] 5f93af1c6 vai: Consistency assertions

Walid Boudebouda walid.boudebouda at varnish-software.com
Mon Aug 4 14:36:20 UTC 2025


FYI: The new assert triggers a panic in test p00000.vtc:

**** v1    CLI RX|Child (3894826) Panic at: Mon, 04 Aug 2025 14:35:13 GMT
> **** v1    CLI RX|Assert error in sml_ai_lease_boc(),
> storage/storage_simple.c line 460:
> **** v1    CLI RX|  Condition(hdl->oc->stobj->priv == hdl->obj) not true.
> **** v1    CLI RX|version = varnish-trunk revision
> 5f93af1c618d0e4214cc7de967a0077efa8e4b5c, vrt api = 21.0
> **** v1    CLI RX|ident =
> Linux,6.8.0-64-generic,x86_64,-jnone,-sdeprecated_persistent,-sdefault,-hcritbit,epoll
> **** v1    CLI RX|now = 156813.822665 (mono), 1754318112.863334 (real)
> **** v1    CLI RX|Backtrace:
> **** v1    CLI RX|  ip=0x55d5e7e7f415 sp=0x74e297ef8070 <VBT_format+0x35>
> **** v1    CLI RX|  ip=0x55d5e7dae4f3 sp=0x74e297ef8090
> <pan_backtrace+0x33>
> **** v1    CLI RX|  ip=0x55d5e7dae237 sp=0x74e297ef80b0 <pan_ic+0x377>
> **** v1    CLI RX|  ip=0x55d5e7e7e48b sp=0x74e297ef8230 <VAS_Fail+0x4b>
> **** v1    CLI RX|  ip=0x55d5e7e420a7 sp=0x74e297ef8270
> <sml_ai_lease_boc+0x277>
> **** v1    CLI RX|  ip=0x55d5e7daa4d9 sp=0x74e297ef82f0 <ObjVAIlease+0xf9>
> **** v1    CLI RX|  ip=0x55d5e7e3d6fe sp=0x74e297ef8320
> <sml_iterator+0x20e>
> **** v1    CLI RX|  ip=0x55d5e7daa161 sp=0x74e297ef8660 <ObjIterate+0x151>
> **** v1    CLI RX|  ip=0x55d5e7d7f5ff sp=0x74e297ef86a0
> <VDP_DeliverObj+0x27f>
> **** v1    CLI RX|  ip=0x55d5e7dfd6ff sp=0x74e297ef86d0 <V1D_Deliver+0x6bf>
> **** v1    CLI RX|  ip=0x55d5e7dba3d7 sp=0x74e297ef87e0
> <cnt_transmit+0x707>
> **** v1    CLI RX|  ip=0x55d5e7db8a7c sp=0x74e297ef8820 <CNT_Request+0x73c>
> **** v1    CLI RX|  ip=0x55d5e7e007de sp=0x74e297ef88e0
> <HTTP1_Session+0xa7e>
> **** v1    CLI RX|  ip=0x55d5e7dffd21 sp=0x74e297ef8960 <http1_req+0x181>
> **** v1    CLI RX|  ip=0x55d5e7df0887 sp=0x74e297ef8990
> <Pool_Work_Thread+0x7c7>
> **** v1    CLI RX|  ip=0x55d5e7deff83 sp=0x74e297ef8a20 <WRK_Thread+0x333>
> **** v1    CLI RX|  ip=0x55d5e7defc0b sp=0x74e297ef95b0 <pool_thread+0xcb>
> **** v1    CLI RX|  ip=0x74e298094ac3 sp=0x74e297ef95e0
> <pthread_condattr_setpshared+0x513>
> **** v1    CLI RX|  ip=0x74e298126850 sp=0x74e297ef9680 <__xmknodat+0x230>



On Mon, Aug 4, 2025 at 12:56 PM Nils Goroll <nils.goroll at uplex.de> wrote:

>
> commit 5f93af1c618d0e4214cc7de967a0077efa8e4b5c
> Author: Nils Goroll <nils.goroll at uplex.de>
> Date:   Mon Aug 4 12:44:32 2025 +0200
>
>     vai: Consistency assertions
>
>     Assert that the oc/boc pair remains the same throughout iteration
>
>     Motivated by #4371
>
> diff --git a/bin/varnishd/storage/storage_simple.c
> b/bin/varnishd/storage/storage_simple.c
> index 608533193..42ab4bf70 100644
> --- a/bin/varnishd/storage/storage_simple.c
> +++ b/bin/varnishd/storage/storage_simple.c
> @@ -456,10 +456,13 @@ sml_ai_lease_boc(struct worker *wrk, vai_hdl vhdl,
> struct vscarab *scarab)
>
>         CAST_VAI_HDL_NOTNULL(hdl, vhdl, SML_HDL_MAGIC);
>         VSCARAB_CHECK_NOTNULL(scarab);
> +       assert(hdl->boc == hdl->oc->boc);
> +       assert(hdl->oc->stobj->priv == hdl->obj);
>
>         if (hdl->avail == hdl->returned) {
>                 hdl->avail = ObjVAIGetExtend(wrk, hdl->oc, hdl->returned,
>                     &state, &hdl->qe);
> +               assert(state >= BOS_STREAM);
>                 if (state == BOS_FAILED) {
>                         hdl->last = NULL;
>                         return (-EPIPE);
> @@ -497,6 +500,7 @@ sml_ai_lease_boc(struct worker *wrk, vai_hdl vhdl,
> struct vscarab *scarab)
>
>         while (hdl->avail > hdl->returned && (viov = VSCARAB_GET(scarab))
> != NULL) {
>                 CHECK_OBJ_NOTNULL(hdl->st, STORAGE_MAGIC); //
> ObjVAIGetExtend ensures
> +               assert(hdl->boc == hdl->oc->boc);
>                 assert(hdl->st_off <= hdl->st->space);
>                 size_t av = hdl->avail - hdl->returned;
>                 size_t l = hdl->st->space - hdl->st_off;
> _______________________________________________
> varnish-commit mailing list
> varnish-commit at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-commit/attachments/20250804/43e960f7/attachment-0001.html>


More information about the varnish-commit mailing list