From phk at FreeBSD.org Mon Aug 4 08:03:05 2025 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 4 Aug 2025 08:03:05 +0000 (UTC) Subject: [master] 9d39c5532 Make blob_b00011.vtc "feature 64bit" for now. Message-ID: <20250804080305.6B7CF964E1@lists.varnish-cache.org> commit 9d39c5532f9b62ec13bf54aeef91e5759de01d4f Author: Poul-Henning Kamp Date: Mon Aug 4 08:01:54 2025 +0000 Make blob_b00011.vtc "feature 64bit" for now. diff --git a/bin/varnishtest/vtest2 b/bin/varnishtest/vtest2 index 11ee91098..dc46782ef 160000 --- a/bin/varnishtest/vtest2 +++ b/bin/varnishtest/vtest2 @@ -1 +1 @@ -Subproject commit 11ee91098c7a1f0a1f8afab9a7356609bfd3cb2d +Subproject commit dc46782efa2adb08e91968efbf154c73acdee67f diff --git a/vmod/tests/blob_b00011.vtc b/vmod/tests/blob_b00011.vtc index 0e97cbd0a..00d313e50 100644 --- a/vmod/tests/blob_b00011.vtc +++ b/vmod/tests/blob_b00011.vtc @@ -5,6 +5,8 @@ varnishtest "VMOD blob workspace overflow conditions" # Since not all of them may be called by all VCLs we also need to ensure this # will not result in a compilation failure. +feature 64bit + varnish v1 -cliok "param.set vcc_feature -err_unref" varnish v1 -cliok "param.set debug +syncvsl" From nils.goroll at uplex.de Mon Aug 4 09:36:04 2025 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 4 Aug 2025 09:36:04 +0000 (UTC) Subject: [master] cd3d9dcef adjust vrt_blob test to changed structure definition Message-ID: <20250804093604.D75079CB3F@lists.varnish-cache.org> commit cd3d9dcef22494131f758331f81c28abe7ce1142 Author: Nils Goroll Date: Mon Aug 4 11:33:59 2025 +0200 adjust vrt_blob test to changed structure definition If this works on 32bit, "feature 64bit" can be removed again Ref 8282cff4b31dce12e100d4d6c78d30b1f4689dd3 Ref #4374 diff --git a/bin/varnishtest/vtest2 b/bin/varnishtest/vtest2 index dc46782ef..11ee91098 160000 --- a/bin/varnishtest/vtest2 +++ b/bin/varnishtest/vtest2 @@ -1 +1 @@ -Subproject commit dc46782efa2adb08e91968efbf154c73acdee67f +Subproject commit 11ee91098c7a1f0a1f8afab9a7356609bfd3cb2d diff --git a/vmod/tests/blob_b00011.vtc b/vmod/tests/blob_b00011.vtc index 00d313e50..29c393107 100644 --- a/vmod/tests/blob_b00011.vtc +++ b/vmod/tests/blob_b00011.vtc @@ -19,7 +19,7 @@ shell { backend be none; sub vcl_recv { - set req.http.vrt_blob = vtc.typesize("uzp"); + set req.http.vrt_blob = vtc.typesize("uuzp"); } sub shrink { From phk at FreeBSD.org Mon Aug 4 09:58:04 2025 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 4 Aug 2025 09:58:04 +0000 (UTC) Subject: [master] a1043abd7 Seems to work on 32bit again, remove feature 64bit Message-ID: <20250804095804.A8611A09A7@lists.varnish-cache.org> commit a1043abd741acfae04456a6f6b564e48d8f5b73a Author: Poul-Henning Kamp Date: Mon Aug 4 09:57:28 2025 +0000 Seems to work on 32bit again, remove feature 64bit diff --git a/vmod/tests/blob_b00011.vtc b/vmod/tests/blob_b00011.vtc index 29c393107..84b1f4056 100644 --- a/vmod/tests/blob_b00011.vtc +++ b/vmod/tests/blob_b00011.vtc @@ -5,8 +5,6 @@ varnishtest "VMOD blob workspace overflow conditions" # Since not all of them may be called by all VCLs we also need to ensure this # will not result in a compilation failure. -feature 64bit - varnish v1 -cliok "param.set vcc_feature -err_unref" varnish v1 -cliok "param.set debug +syncvsl" From nils.goroll at uplex.de Mon Aug 4 10:56:05 2025 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 4 Aug 2025 10:56:05 +0000 (UTC) Subject: [master] 69f9ca40c cache_fetch: Clarify that we can only replace an object before streaming Message-ID: <20250804105605.13C71A2D5E@lists.varnish-cache.org> commit 69f9ca40ccfda482d10d877165e998c4511aa28d Author: Nils Goroll Date: Mon Aug 4 12:40:40 2025 +0200 cache_fetch: Clarify that we can only replace an object before streaming Motivated by #4371 diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c index 0b3685e45..7cd779037 100644 --- a/bin/varnishd/cache/cache_fetch.c +++ b/bin/varnishd/cache/cache_fetch.c @@ -944,6 +944,8 @@ vbf_stp_error(struct worker *wrk, struct busyobj *bo) VSLb_ts_busyobj(bo, "Error", now); if (oc->stobj->stevedore != NULL) { + // replacing an already fetched object with a "synth" one + assert(oc->boc->state < BOS_STREAM); oc->boc->fetched_so_far = 0; ObjFreeObj(bo->wrk, oc); } From nils.goroll at uplex.de Mon Aug 4 10:56:05 2025 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 4 Aug 2025 10:56:05 +0000 (UTC) Subject: [master] 5f93af1c6 vai: Consistency assertions Message-ID: <20250804105605.2AFE3A2D61@lists.varnish-cache.org> commit 5f93af1c618d0e4214cc7de967a0077efa8e4b5c Author: Nils Goroll 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; From nils.goroll at uplex.de Mon Aug 4 13:50:05 2025 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 4 Aug 2025 13:50:05 +0000 (UTC) Subject: [master] e81775bc3 cache_panic: Add missing struct boc members Message-ID: <20250804135005.41F1BA97FC@lists.varnish-cache.org> commit e81775bc3bae8e5571cfe31929d38bd00350bbb8 Author: Nils Goroll Date: Mon Aug 4 15:47:53 2025 +0200 cache_panic: Add missing struct boc members Motivated by #4371 diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c index eef6cb527..6d401f578 100644 --- a/bin/varnishd/cache/cache_panic.c +++ b/bin/varnishd/cache/cache_panic.c @@ -218,9 +218,13 @@ pan_boc(struct vsb *vsb, const struct boc *boc) if (PAN_dump_struct(vsb, boc, BOC_MAGIC, "boc")) return; VSB_printf(vsb, "refcnt = %u,\n", boc->refcount); + VSB_printf(vsb, "stevedore_priv = %p,\n", boc->stevedore_priv); VSB_printf(vsb, "state = %s,\n", boc_state_2str(boc->state)); VSB_printf(vsb, "vary = %p,\n", boc->vary); - VSB_printf(vsb, "stevedore_priv = %p,\n", boc->stevedore_priv); + VSB_printf(vsb, "fetched_so_far = %ju,\n", (uintmax_t)boc->fetched_so_far); + VSB_printf(vsb, "delivered_so_far = %ju,\n", (uintmax_t)boc->delivered_so_far); + VSB_printf(vsb, "transit_buffer = %ju,\n", (uintmax_t)boc->transit_buffer); + VSB_printf(vsb, "VSLIST_FIRST(vai_q_head) = %p,\n", VSLIST_FIRST(&boc->vai_q_head)); VSB_indent(vsb, -2); VSB_cat(vsb, "},\n"); } From walid.boudebouda at varnish-software.com Mon Aug 4 14:36:20 2025 From: walid.boudebouda at varnish-software.com (Walid Boudebouda) Date: Mon, 4 Aug 2025 16:36:20 +0200 Subject: [master] 5f93af1c6 vai: Consistency assertions In-Reply-To: <20250804105605.2AFE3A2D61@lists.varnish-cache.org> References: <20250804105605.2AFE3A2D61@lists.varnish-cache.org> Message-ID: 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 > **** v1 CLI RX| ip=0x55d5e7dae4f3 sp=0x74e297ef8090 > > **** v1 CLI RX| ip=0x55d5e7dae237 sp=0x74e297ef80b0 > **** v1 CLI RX| ip=0x55d5e7e7e48b sp=0x74e297ef8230 > **** v1 CLI RX| ip=0x55d5e7e420a7 sp=0x74e297ef8270 > > **** v1 CLI RX| ip=0x55d5e7daa4d9 sp=0x74e297ef82f0 > **** v1 CLI RX| ip=0x55d5e7e3d6fe sp=0x74e297ef8320 > > **** v1 CLI RX| ip=0x55d5e7daa161 sp=0x74e297ef8660 > **** v1 CLI RX| ip=0x55d5e7d7f5ff sp=0x74e297ef86a0 > > **** v1 CLI RX| ip=0x55d5e7dfd6ff sp=0x74e297ef86d0 > **** v1 CLI RX| ip=0x55d5e7dba3d7 sp=0x74e297ef87e0 > > **** v1 CLI RX| ip=0x55d5e7db8a7c sp=0x74e297ef8820 > **** v1 CLI RX| ip=0x55d5e7e007de sp=0x74e297ef88e0 > > **** v1 CLI RX| ip=0x55d5e7dffd21 sp=0x74e297ef8960 > **** v1 CLI RX| ip=0x55d5e7df0887 sp=0x74e297ef8990 > > **** v1 CLI RX| ip=0x55d5e7deff83 sp=0x74e297ef8a20 > **** v1 CLI RX| ip=0x55d5e7defc0b sp=0x74e297ef95b0 > **** v1 CLI RX| ip=0x74e298094ac3 sp=0x74e297ef95e0 > > **** v1 CLI RX| ip=0x74e298126850 sp=0x74e297ef9680 <__xmknodat+0x230> On Mon, Aug 4, 2025 at 12:56?PM Nils Goroll wrote: > > commit 5f93af1c618d0e4214cc7de967a0077efa8e4b5c > Author: Nils Goroll > 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: From nils.goroll at uplex.de Tue Aug 5 09:03:04 2025 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 5 Aug 2025 09:03:04 +0000 (UTC) Subject: [master] e3a92108e vai: Remove wrong assertion Message-ID: <20250805090304.D8046A8CC7@lists.varnish-cache.org> commit e3a92108e647c064647d91b3688e17ac6c3c5585 Author: Nils Goroll Date: Tue Aug 5 11:00:35 2025 +0200 vai: Remove wrong assertion I had temporarily built with plain ./configure to get default compiler flags, so I had not seen locally that for -sdeprecated_persistent, stobj->priv is not the struct object * diff --git a/bin/varnishd/storage/storage_simple.c b/bin/varnishd/storage/storage_simple.c index 42ab4bf70..ab5b03ad0 100644 --- a/bin/varnishd/storage/storage_simple.c +++ b/bin/varnishd/storage/storage_simple.c @@ -457,7 +457,6 @@ 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, From nils.goroll at uplex.de Tue Aug 5 10:33:05 2025 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 5 Aug 2025 10:33:05 +0000 (UTC) Subject: [master] 21316e4d0 vai: fix another glitch from 84d1fc92f436e9c94d127ec45e779b36f0f7c2a7 Message-ID: <20250805103305.78286ABCA2@lists.varnish-cache.org> commit 21316e4d05fe91c9722fc887d5146077b5d0c393 Author: Nils Goroll Date: Tue Aug 5 12:31:01 2025 +0200 vai: fix another glitch from 84d1fc92f436e9c94d127ec45e779b36f0f7c2a7 We need to increment the return value to signify that we added a viov. Potentially related to #4371 diff --git a/bin/varnishd/storage/storage_simple.c b/bin/varnishd/storage/storage_simple.c index ab5b03ad0..05f224cdf 100644 --- a/bin/varnishd/storage/storage_simple.c +++ b/bin/varnishd/storage/storage_simple.c @@ -487,6 +487,7 @@ sml_ai_lease_boc(struct worker *wrk, vai_hdl vhdl, struct vscarab *scarab) viov->iov.iov_base = null_iov; viov->iov.iov_len = 0; viov->lease = ptr2lease(hdl->last); + r++; } if (hdl->last != NULL) hdl->last = NULL; From nils.goroll at uplex.de Tue Aug 5 13:11:05 2025 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 5 Aug 2025 13:11:05 +0000 (UTC) Subject: [master] fc18d8a52 vai: Never access the object list unprotected for a busy object Message-ID: <20250805131105.603D1B11D3@lists.varnish-cache.org> commit fc18d8a52f19b089d4432f1d81a14f7bab9162d5 Author: Nils Goroll Date: Tue Aug 5 14:51:28 2025 +0200 vai: Never access the object list unprotected for a busy object For a busy object, we must never access the object list outside the boc mutex, otherwise we can see basically arbitrary pointer values (like a retired segment from sml_trimstore or just a random pointer). Fixes #4371 diff --git a/bin/varnishd/storage/storage_simple.c b/bin/varnishd/storage/storage_simple.c index 05f224cdf..054b02881 100644 --- a/bin/varnishd/storage/storage_simple.c +++ b/bin/varnishd/storage/storage_simple.c @@ -666,8 +666,6 @@ sml_ai_init(struct worker *wrk, struct objcore *oc, struct ws *ws, hdl->stv = oc->stobj->stevedore; CHECK_OBJ_NOTNULL(hdl->stv, STEVEDORE_MAGIC); - hdl->st = VTAILQ_LAST(&hdl->obj->list, storagehead); - CHECK_OBJ_ORNULL(hdl->st, STORAGE_MAGIC); hdl->qe.magic = VAI_Q_MAGIC; hdl->qe.cb = notify; @@ -675,8 +673,11 @@ sml_ai_init(struct worker *wrk, struct objcore *oc, struct ws *ws, hdl->qe.priv = notify_priv; hdl->boc = HSH_RefBoc(oc); - if (hdl->boc == NULL) + if (hdl->boc == NULL) { + hdl->st = VTAILQ_LAST(&hdl->obj->list, storagehead); + CHECK_OBJ_ORNULL(hdl->st, STORAGE_MAGIC); return (hdl); + } /* we only initialize notifications if we have a boc, so * any wrong attempt triggers magic checks. */ From nils.goroll at uplex.de Tue Aug 12 09:21:06 2025 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 12 Aug 2025 09:21:06 +0000 (UTC) Subject: [master] 2a5345de1 vsl: Facilitate ESI_xmlerror processing Message-ID: <20250812092106.C3FEA117D94@lists.varnish-cache.org> commit 2a5345de14efee39838f87c57908fe10d02decc2 Author: Nils Goroll Date: Wed Aug 6 12:36:24 2025 +0200 vsl: Facilitate ESI_xmlerror processing varnishncsa supports the %{VSL:tag:record-prefix[field]}x format variable to output records which "have this prefix as the first part of the record content followed by a colon". It would be convenient to be able to use this variable also for ESI_xmlerror as %{VSL:ESI_xmlerror:WARN}x %{VSL:ESI_xmlerror:ERR}x" yet the prefix was missing a colon. This patch adds it, plus it also adds a WARN: prefix to "No ESI processing" messages. Most of the diff was produced using sed -i '/ESI_xmlerror/ s:\(ERR\|WARN\):\0\::' $(git grep -l ESI_xml) diff --git a/bin/varnishd/cache/cache_esi_parse.c b/bin/varnishd/cache/cache_esi_parse.c index 5145b016c..0b183a35d 100644 --- a/bin/varnishd/cache/cache_esi_parse.c +++ b/bin/varnishd/cache/cache_esi_parse.c @@ -201,7 +201,7 @@ static void vep_error(const struct vep_state *vep, const char *p) { VSC_C_main->esi_errors++; - VSLb(vep->vc->wrk->vsl, SLT_ESI_xmlerror, "ERR after %zd %s", + VSLb(vep->vc->wrk->vsl, SLT_ESI_xmlerror, "ERR: after %zd %s", vep->o_last, p); } @@ -213,7 +213,7 @@ static void vep_warn(const struct vep_state *vep, const char *p) { VSC_C_main->esi_warnings++; - VSLb(vep->vc->wrk->vsl, SLT_ESI_xmlerror, "WARN after %zd %s", + VSLb(vep->vc->wrk->vsl, SLT_ESI_xmlerror, "WARN: after %zd %s", vep->o_last, p); } @@ -673,14 +673,14 @@ VEP_Parse(struct vep_state *vep, const char *p, size_t l) vep->state = VEP_STARTTAG; } else if (p < e && *p == (char)0xeb) { VSLb(vep->vc->wrk->vsl, SLT_ESI_xmlerror, - "No ESI processing, " + "WARN: No ESI processing, " "first char not '<' but BOM." " (See feature esi_remove_bom)" ); vep->state = VEP_NOTXML; } else if (p < e) { VSLb(vep->vc->wrk->vsl, SLT_ESI_xmlerror, - "No ESI processing, " + "WARN: No ESI processing, " "first char not '<'." " (See feature esi_disable_xml_check)" ); diff --git a/bin/varnishtest/tests/e00001.vtc b/bin/varnishtest/tests/e00001.vtc index c903a0acb..9e4cf5286 100644 --- a/bin/varnishtest/tests/e00001.vtc +++ b/bin/varnishtest/tests/e00001.vtc @@ -23,8 +23,8 @@ varnish v1 -vcl+backend { } -start logexpect l1 -v v1 -g raw { - expect * * ESI_xmlerror {^ERR after 3 ESI 1.0 element nested in } - expect 0 = ESI_xmlerror {^ERR after 3 ESI 1.0 Nested