From nils.goroll at uplex.de Mon Jun 2 12:21:05 2025 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 2 Jun 2025 12:21:05 +0000 (UTC) Subject: [master] 8f87d79c6 cci: try to make it work with the vtest submodule Message-ID: <20250602122105.2AC9764881@lists.varnish-cache.org> commit 8f87d79c6775af592ad1697696d52c3ea99eaa1a Author: Nils Goroll Date: Mon Jun 2 14:19:25 2025 +0200 cci: try to make it work with the vtest submodule diff --git a/.circleci/config.yml b/.circleci/config.yml index 19e24a857..55c547ac2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,6 +48,7 @@ jobs: python3 \ python3-sphinx - checkout + - run: git submodule update --init - when: condition: << pipeline.parameters.dist-url >> steps: @@ -224,6 +225,7 @@ jobs: working_directory: /workspace steps: - checkout + - run: git submodule update --init - run: name: Extract and build command: | From nils.goroll at uplex.de Mon Jun 2 12:26:04 2025 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 2 Jun 2025 12:26:04 +0000 (UTC) Subject: [master] 6b4bec494 cci: try again Message-ID: <20250602122604.C162764CDC@lists.varnish-cache.org> commit 6b4bec4943109f0077964a816d293f195f9f2351 Author: Nils Goroll Date: Mon Jun 2 14:24:32 2025 +0200 cci: try again (where again was the advantage of all that stuff over just running a shell script if the yaml mostly consists of one?) diff --git a/.circleci/config.yml b/.circleci/config.yml index 55c547ac2..d8537fe50 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,7 +48,6 @@ jobs: python3 \ python3-sphinx - checkout - - run: git submodule update --init - when: condition: << pipeline.parameters.dist-url >> steps: @@ -79,6 +78,7 @@ jobs: name: Create the dist tarball command: | git checkout << pipeline.parameters.vc-commit >> + git submodule update --init # Locally built tarballs are always built with weekly in package name touch .is_weekly # If version is "trunk", override version to add date @@ -225,10 +225,10 @@ jobs: working_directory: /workspace steps: - checkout - - run: git submodule update --init - run: name: Extract and build command: | + git submodule update --init case "<< parameters.dist >>" in almalinux|fedora) case "<< parameters.dist >>:<< parameters.release >>" in From nils.goroll at uplex.de Mon Jun 2 12:28:04 2025 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 2 Jun 2025 12:28:04 +0000 (UTC) Subject: [master] 55161dfa1 cci: try again Message-ID: <20250602122804.E4A5664FC5@lists.varnish-cache.org> commit 55161dfa1d331fa47f7e8a8ffb07e2c59f204347 Author: Nils Goroll Date: Mon Jun 2 14:26:40 2025 +0200 cci: try again (oh and did I mention what I think about CI code I can not test-run locally?) diff --git a/.circleci/config.yml b/.circleci/config.yml index d8537fe50..4aa420d3f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -228,7 +228,6 @@ jobs: - run: name: Extract and build command: | - git submodule update --init case "<< parameters.dist >>" in almalinux|fedora) case "<< parameters.dist >>:<< parameters.release >>" in @@ -323,6 +322,8 @@ jobs: ;; esac + git submodule update --init + case "<< parameters.dist >>" in archlinux) useradd varnish From nils.goroll at uplex.de Mon Jun 2 13:22:05 2025 From: nils.goroll at uplex.de (Nils Goroll) Date: Mon, 2 Jun 2025 13:22:05 +0000 (UTC) Subject: [master] 721024d75 doc: No return(retry) from vcl_backend_fetch (yet) Message-ID: <20250602132205.B3A549037B@lists.varnish-cache.org> commit 721024d7578b82250207a15b8fcedee6bf3598ee Author: Nils Goroll Date: Mon Jun 2 15:15:47 2025 +0200 doc: No return(retry) from vcl_backend_fetch (yet) Closes #4342 diff --git a/doc/sphinx/reference/vcl_step.rst b/doc/sphinx/reference/vcl_step.rst index ee07f6169..67ddf0818 100644 --- a/doc/sphinx/reference/vcl_step.rst +++ b/doc/sphinx/reference/vcl_step.rst @@ -301,6 +301,8 @@ The `vcl_backend_fetch` subroutine may terminate with calling | ``beresp.reason`` being preset to the arguments of ``error()`` if | arguments are provided. +.. could add return(retry) if there was a(nother) use case, see also https://github.com/varnishcache/varnish-cache/issues/4342 + Before calling `vcl_backend_fetch`, Varnish core prepares the `bereq` backend request as follows: From noreply at github.com Mon Jun 2 14:17:06 2025 From: noreply at github.com (GitHub) Date: Mon, 2 Jun 2025 14:17:06 +0000 (UTC) Subject: [master] 033d1d45e coverity: Attempt at recursive git clone Message-ID: <20250602141706.121549240D@lists.varnish-cache.org> commit 033d1d45ef72b806e6bd5ba73cacb1ea9835ec8f Author: Dridi Boukelmoune Date: Mon Jun 2 14:16:35 2025 +0000 coverity: Attempt at recursive git clone Trying the YAML change before committing to master is too complicated. diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 308502df6..3c3d28a00 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -26,7 +26,9 @@ jobs: libunwind-dev \ pkg-config \ python3-sphinx - - uses: actions/checkout at v2 + - uses: actions/checkout at v4 + with: + submodules: true - run: ./autogen.sh - run: ./configure --with-persistent-storage - uses: vapier/coverity-scan-action at v1.8.0 From dridi at varni.sh Mon Jun 2 14:21:15 2025 From: dridi at varni.sh (Dridi Boukelmoune) Date: Mon, 2 Jun 2025 14:21:15 +0000 Subject: [master] 55161dfa1 cci: try again In-Reply-To: <20250602122804.E4A5664FC5@lists.varnish-cache.org> References: <20250602122804.E4A5664FC5@lists.varnish-cache.org> Message-ID: On Mon, Jun 2, 2025 at 12:28?PM Nils Goroll wrote: > > > commit 55161dfa1d331fa47f7e8a8ffb07e2c59f204347 > Author: Nils Goroll > Date: Mon Jun 2 14:26:40 2025 +0200 > > cci: try again > > (oh and did I mention what I think about CI code I can not test-run locally?) I had the same problem with the github action for coverity scans. At least with cci you can iterate in a pull request. From dridi at varni.sh Mon Jun 2 14:26:23 2025 From: dridi at varni.sh (Dridi Boukelmoune) Date: Mon, 2 Jun 2025 14:26:23 +0000 Subject: [master] 6b4bec494 cci: try again In-Reply-To: <20250602122604.C162764CDC@lists.varnish-cache.org> References: <20250602122604.C162764CDC@lists.varnish-cache.org> Message-ID: On Mon, Jun 2, 2025 at 12:26?PM Nils Goroll wrote: > > > commit 6b4bec4943109f0077964a816d293f195f9f2351 > Author: Nils Goroll > Date: Mon Jun 2 14:24:32 2025 +0200 > > cci: try again > > (where again was the advantage of all that stuff over just running a shell > script if the yaml mostly consists of one?) In ye olde travis ci times I dared to suggest having shell scripts executed from the yaml configuration and got a flat no. I didn't even try to ask for circle ci, and from the look of it things look even worse on the github actions side. From nils.goroll at uplex.de Tue Jun 3 08:17:06 2025 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 3 Jun 2025 08:17:06 +0000 (UTC) Subject: [master] dd4966e53 vtc: Test / demo VCL-controlled range processing on the client side Message-ID: <20250603081706.1C76E91A49@lists.varnish-cache.org> commit dd4966e53ea7149095250a2b7471bb139c976438 Author: Nils Goroll Date: Tue Jun 3 10:14:01 2025 +0200 vtc: Test / demo VCL-controlled range processing on the client side Motivated by #4336 diff --git a/bin/varnishtest/tests/c00034.vtc b/bin/varnishtest/tests/c00034.vtc index 86152e004..394a7a91e 100644 --- a/bin/varnishtest/tests/c00034.vtc +++ b/bin/varnishtest/tests/c00034.vtc @@ -5,14 +5,41 @@ server s1 { txresp -bodylen 100 } -start +######################################################################## +# VCL control over range processing with built-in range support disabled + varnish v1 -vcl+backend { sub vcl_backend_response { set beresp.do_stream = false; } + sub vcl_deliver { + if (req.http.range) { + set resp.filters = "range"; + } + set resp.http.Accept-Ranges = "bytes"; + } } -start varnish v1 -cliok "param.set http_range_support off" +client c1 { + txreq -hdr "Range: bytes=0-9" + rxresp + expect resp.status == 206 + expect resp.bodylen == 10 + expect resp.http.content-range == "bytes 0-9/100" + expect resp.http.accept-ranges == "bytes" +} -run + +######################################################################## +# Neither explicit range processing nor built-in + +varnish v1 -vcl+backend { + sub vcl_backend_response { + set beresp.do_stream = false; + } +} + client c1 { txreq -hdr "Range: bytes=0-9" rxresp @@ -21,10 +48,13 @@ client c1 { expect resp.bodylen == 100 } -run -varnish v1 -expect s_resp_bodybytes == 100 +varnish v1 -expect s_resp_bodybytes == 110 varnish v1 -vsl_catchup +######################################################################## +# Only built-in processing + varnish v1 -cliok "param.set http_range_support on" client c2 { @@ -74,7 +104,7 @@ client c2 { expect resp.bodylen == 0 } -run -varnish v1 -expect s_resp_bodybytes == 100 +varnish v1 -expect s_resp_bodybytes == 110 varnish v1 -vsl_catchup @@ -125,7 +155,7 @@ client c3 { expect resp.http.content-range == "bytes 0-99/100" } -run -varnish v1 -expect s_resp_bodybytes == 501 +varnish v1 -expect s_resp_bodybytes == 511 varnish v1 -vsl_catchup From nils.goroll at uplex.de Tue Jun 3 15:05:05 2025 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 3 Jun 2025 15:05:05 +0000 (UTC) Subject: [master] 3a35d8284 v1f_read: Coveritification Message-ID: <20250603150505.80F20A664D@lists.varnish-cache.org> commit 3a35d82849e079c863d78421d1e59b81238f7900 Author: Nils Goroll Date: Tue Jun 3 16:54:23 2025 +0200 v1f_read: Coveritification CID1605314 reports a potential overflow from i + l, which can not happen for realistic values. Because the maximum is so far off realistic values (we are reading into substantially smaller buffers), just add bounds checking stead of detecting the overflow. diff --git a/bin/varnishd/http1/cache_http1_vfp.c b/bin/varnishd/http1/cache_http1_vfp.c index fbc3dcb8b..8a2fb3915 100644 --- a/bin/varnishd/http1/cache_http1_vfp.c +++ b/bin/varnishd/http1/cache_http1_vfp.c @@ -85,6 +85,10 @@ v1f_read(const struct vfp_ctx *vc, struct http_conn *htc, void *d, ssize_t len) if (i == 0) htc->doclose = SC_RESP_CLOSE; } + assert(i >= 0); + assert(l >= 0); + assert(i < SSIZE_MAX / 2); + assert(l < SSIZE_MAX / 2); return (i + l); } From nils.goroll at uplex.de Tue Jun 3 15:05:05 2025 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 3 Jun 2025 15:05:05 +0000 (UTC) Subject: [master] 4ee3a2a2c cache_http1_pipe: Coveritification Message-ID: <20250603150505.944B6A6651@lists.varnish-cache.org> commit 4ee3a2a2ce79ccc1784bf6a6ccab7fd351639857 Author: Nils Goroll Date: Tue Jun 3 17:00:08 2025 +0200 cache_http1_pipe: Coveritification CID1605321 reports an integer overflow. The only way I can see this happening is if j > i then i -= j would _underflow_. Not sure if this is what coverity sees, but at any rate, we know that write() will never return a value greater than the length argument. diff --git a/bin/varnishd/http1/cache_http1_pipe.c b/bin/varnishd/http1/cache_http1_pipe.c index 32d7471fe..867281477 100644 --- a/bin/varnishd/http1/cache_http1_pipe.c +++ b/bin/varnishd/http1/cache_http1_pipe.c @@ -61,6 +61,7 @@ rdf(int fd0, int fd1, uint64_t *pcnt) VTCP_Assert(j); if (j <= 0) return (1); + assert(j <= i); *pcnt += j; if (i != j) VTIM_sleep(0.1); /* XXX hack */ From nils.goroll at uplex.de Tue Jun 3 15:21:05 2025 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 3 Jun 2025 15:21:05 +0000 (UTC) Subject: [master] 9b31fcdcd vsl: Coveritification Message-ID: <20250603152105.C6B6BA7241@lists.varnish-cache.org> commit 9b31fcdcd6d1638e7f0e4baa3c21567970e0b642 Author: Nils Goroll Date: Tue Jun 3 17:17:44 2025 +0200 vsl: Coveritification CID1605309 reports a potential "cast overflow" for l = VSL_OVERHEAD + VSL_WORDS(VSL_LEN(c->buf)); This can not happen because VSL_LEN is limited to UINT16_MAX plus VSL_OVERHEAD (3). Hopefully the explicit cast will make this clear. diff --git a/include/vapi/vsl_int.h b/include/vapi/vsl_int.h index 87d38b04c..b220a82e3 100644 --- a/include/vapi/vsl_int.h +++ b/include/vapi/vsl_int.h @@ -81,14 +81,14 @@ #define VSL_VERSHIFT 16 #define VSL_IDMASK 0xff #define VSL_IDSHIFT 24 -#define VSL_OVERHEAD 3 +#define VSL_OVERHEAD 3U #define VSL_VERSION_2 0x0 #define VSL_VERSION_3 0x1 #define VSL_WORDS(len) (((len) + 3) / 4) #define VSL_BYTES(words) ((words) * 4) #define VSL_END(ptr, len) ((ptr) + VSL_OVERHEAD + VSL_WORDS(len)) #define VSL_NEXT(ptr) VSL_END(ptr, VSL_LEN(ptr)) -#define VSL_LEN(ptr) ((ptr)[0] & VSL_LENMASK) +#define VSL_LEN(ptr) ((uint16_t)((ptr)[0] & VSL_LENMASK)) #define VSL_VER(ptr) (((ptr)[0] >> VSL_VERSHIFT) & VSL_VERMASK) #define VSL_TAG(ptr) ((enum VSL_tag_e)((ptr)[0] >> VSL_IDSHIFT)) #define VSL_ID64(ptr) (((uint64_t)((ptr)[2])<<32) | ((ptr)[1])) From nils.goroll at uplex.de Thu Jun 12 17:18:07 2025 From: nils.goroll at uplex.de (Nils Goroll) Date: Thu, 12 Jun 2025 17:18:07 +0000 (UTC) Subject: [master] 81c8e58b5 cache_expire: use vtim_real type Message-ID: <20250612171807.3909FA8D11@lists.varnish-cache.org> commit 81c8e58b5e02365734b9d628d24b30a6eff0d88c Author: Nils Goroll Date: Thu Jun 12 19:16:15 2025 +0200 cache_expire: use vtim_real type diff --git a/bin/varnishd/cache/cache_expire.c b/bin/varnishd/cache/cache_expire.c index ff1c04152..0aaa354f6 100644 --- a/bin/varnishd/cache/cache_expire.c +++ b/bin/varnishd/cache/cache_expire.c @@ -287,7 +287,7 @@ EXP_Rearm(struct objcore *oc, vtim_real now, */ static void -exp_inbox(struct exp_priv *ep, struct objcore *oc, unsigned flags, double now) +exp_inbox(struct exp_priv *ep, struct objcore *oc, unsigned flags, vtim_real now) { CHECK_OBJ_NOTNULL(ep, EXP_PRIV_MAGIC); From nils.goroll at uplex.de Fri Jun 13 09:34:05 2025 From: nils.goroll at uplex.de (Nils Goroll) Date: Fri, 13 Jun 2025 09:34:05 +0000 (UTC) Subject: [master] adb0b3778 import __containerof() from freebsd Message-ID: <20250613093406.028B6A1959@lists.varnish-cache.org> commit adb0b3778858405c4d504026cd2d9845a92fad64 Author: Nils Goroll Date: Fri Jun 13 09:28:22 2025 +0200 import __containerof() from freebsd it is already needed by VLIST_PREV and VSTAILQ_LAST from vqueue.h diff --git a/flint.lnt b/flint.lnt index 6607b23ad..0a29357b9 100644 --- a/flint.lnt +++ b/flint.lnt @@ -261,7 +261,7 @@ /////////////////////////////////////////////////////////////////////// // -emacro(527, NEEDLESS) // unreachable code --emacro(160, _vtake) // The sequence '( {' is non standard +-emacro(160, _vtake, __containerof) // The sequence '( {' is non standard +rw( __typeof__ ) /////////////////////////////////////////////////////////////////////// diff --git a/include/vdef.h b/include/vdef.h index 381a4f799..d71716c47 100644 --- a/include/vdef.h +++ b/include/vdef.h @@ -38,6 +38,7 @@ */ #include +#include #ifdef VDEF_H_INCLUDED # error "vdef.h included multiple times" @@ -282,3 +283,31 @@ typedef struct { /* #3020 dummy definitions until PR is merged*/ #define LIKELY(x) (x) #define UNLIKELY(x) (x) + +#ifndef __DEQUALIFY +#define __DEQUALIFY(type, var) ((type)(uintptr_t)(const volatile void *)(var)) +#endif + +/********************************************************************** + * vqueue.h presupposes the __containerof() macro for VSTAILQ_LAST(), + * which is in FreeBSD cdefs.h. + * + * This differs from cdefs.h in that uintptr_t is taken from stdint.h, and + * offsetof() is taken from stddef.h. + */ + +/* + * Given the pointer x to the member m of the struct s, return + * a pointer to the containing structure. When using GCC, we first + * assign pointer x to a local variable, to check that its type is + * compatible with member m. + */ +#if __GNUC_PREREQ__(3, 1) +#define __containerof(x, s, m) ({ \ + const volatile __typeof(((s *)0)->m) *__x = (x); \ + __DEQUALIFY(s *, (const volatile char *)__x - offsetof(s, m)); \ +}) +#else +#define __containerof(x, s, m) \ + __DEQUALIFY(s *, (const volatile char *)(x) - offsetof(s, m)) +#endif From nils.goroll at uplex.de Sat Jun 14 20:33:05 2025 From: nils.goroll at uplex.de (Nils Goroll) Date: Sat, 14 Jun 2025 20:33:05 +0000 (UTC) Subject: [master] 7df0a8fcf cache_expire: Add assertion Message-ID: <20250614203305.DB9A7941A8@lists.varnish-cache.org> commit 7df0a8fcff3d79876fa1170980878cdabda9c9e2 Author: Nils Goroll Date: Sat Jun 14 15:53:44 2025 +0200 cache_expire: Add assertion the only way an oc can end up on in the inbox is through exp_mail_it(), and it sets the flag. diff --git a/bin/varnishd/cache/cache_expire.c b/bin/varnishd/cache/cache_expire.c index 0aaa354f6..8e459140b 100644 --- a/bin/varnishd/cache/cache_expire.c +++ b/bin/varnishd/cache/cache_expire.c @@ -440,6 +440,7 @@ exp_thread(struct worker *wrk, void *priv) CHECK_OBJ_ORNULL(oc, OBJCORE_MAGIC); if (oc != NULL) { assert(oc->refcnt >= 1); + assert(oc->exp_flags & OC_EF_POSTED); VSTAILQ_REMOVE(&ep->inbox, oc, objcore, exp_list); VSC_C_main->exp_received++; tnext = 0; From nils.goroll at uplex.de Sat Jun 14 20:33:05 2025 From: nils.goroll at uplex.de (Nils Goroll) Date: Sat, 14 Jun 2025 20:33:05 +0000 (UTC) Subject: [master] d2540ce11 __containerof is already defined on bsd Message-ID: <20250614203305.F20E9941AB@lists.varnish-cache.org> commit d2540ce118d15362c0f3945ca0512eb87ba88f70 Author: Nils Goroll Date: Sat Jun 14 22:31:53 2025 +0200 __containerof is already defined on bsd diff --git a/include/vdef.h b/include/vdef.h index d71716c47..5c5b5325a 100644 --- a/include/vdef.h +++ b/include/vdef.h @@ -302,6 +302,7 @@ typedef struct { * assign pointer x to a local variable, to check that its type is * compatible with member m. */ +#ifndef __containerof #if __GNUC_PREREQ__(3, 1) #define __containerof(x, s, m) ({ \ const volatile __typeof(((s *)0)->m) *__x = (x); \ @@ -311,3 +312,4 @@ typedef struct { #define __containerof(x, s, m) \ __DEQUALIFY(s *, (const volatile char *)(x) - offsetof(s, m)) #endif +#endif From dridi.boukelmoune at gmail.com Mon Jun 16 09:45:05 2025 From: dridi.boukelmoune at gmail.com (Dridi Boukelmoune) Date: Mon, 16 Jun 2025 09:45:05 +0000 (UTC) Subject: [master] 8a80f7484 vtc-bisect: Ignore good revision in run mode Message-ID: <20250616094505.35A216429D@lists.varnish-cache.org> commit 8a80f74846443d04360f648df7aa0c5e1ad6b29e Author: Dridi Boukelmoune Date: Mon Jun 16 11:38:44 2025 +0200 vtc-bisect: Ignore good revision in run mode When the good revision is omitted, the vtc-bisect.sh script assumes the good revision to be the last tag prior to the bad revision. When it calls back to itself to launch an automated git-bisect run, it does so without specifying the good/bad revisions because it already set up the git-bisect environment. Once git-bisect is started, git-describe (used to find the tag) may fail. Delaying the last tag fallback is enough to avoid this problem. diff --git a/tools/vtc-bisect.sh b/tools/vtc-bisect.sh index 7a085a08d..b5e200787 100755 --- a/tools/vtc-bisect.sh +++ b/tools/vtc-bisect.sh @@ -125,11 +125,11 @@ BISECT_BAD=${BISECT_BAD:-HEAD} MAKE_JOBS=${MAKE_JOBS:-8} VTC_FILE=${VTC_FILE:-bisect.vtc} -[ -n "$BISECT_GOOD" ] || BISECT_GOOD=$(git describe --abbrev=0 "$BISECT_BAD") - # run mode short circuit "$RUN_MODE" && run +test -n "$BISECT_GOOD" || BISECT_GOOD=$(git describe --abbrev=0 "$BISECT_BAD") + # bisect mode ROOT_DIR=$(git rev-parse --show-toplevel) From phk at FreeBSD.org Mon Jun 16 14:00:05 2025 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Mon, 16 Jun 2025 14:00:05 +0000 (UTC) Subject: [master] 552f5c1ff Renovate the gcov_digest script. Message-ID: <20250616140005.C8ED79AA72@lists.varnish-cache.org> commit 552f5c1ff8453ac45e5aca2775ca0ff728f0fd29 Author: Poul-Henning Kamp Date: Mon Jun 16 13:58:33 2025 +0000 Renovate the gcov_digest script. diff --git a/tools/gcov_digest.py b/tools/gcov_digest.py index eb6fa58c3..309958fba 100644 --- a/tools/gcov_digest.py +++ b/tools/gcov_digest.py @@ -55,39 +55,92 @@ import sys import getopt import subprocess -counts = {} -lengths = {} +source_files = {} + +class SourceFile(): + ''' GCOV counts for a single source file ''' + + def __init__(self, path): + self.path = path + self.counts = {} + self.length = 0 + source_files[path] = self + + def __lt__(self, other): + return self.path < other.path + + def ingest(self, fd): + ''' Ingest a gcov file ''' + for line in fd: + flds = line.split(':', maxsplit=2) + cnt = flds[0].strip() + if cnt == "-": + continue + if cnt == "#####": + cnt = 0 + else: + cnt = int(cnt) + lno = int(flds[1]) + if lno not in self.counts: + self.counts[lno] = cnt + else: + self.counts[lno] += cnt + self.length = lno + + def summary(self): + """ + Produce compact output file + + Format: + linefm [lineto] count + + "+" in linefm means "previous line + 1" + "." in count means "same as previous count" + """ + yield "/" + self.path + " " + str(self.length) + lnos = list(sorted(self.counts.items())) + pln = -1 + pcn = -1 + while lnos: + ln, cn = lnos.pop(0) + lnl = ln + while lnos: + lnn, cnn = lnos[0] + if lnl + 1 != lnn or cnn != cn: + break + lnos.pop(0) + lnl = lnn + if ln == pln + 1: + s = "+ " + else: + s = "%d " % ln + + if ln != lnl: + s += "%d " % lnl + pln = lnl + else: + pln = ln + + if cn == pcn: + s += "." + else: + s += "%d" % cn + pcn = cn + yield s exclude = [".git", ".deps",] -def process_gcov(fn, sn): +def process_gcov(fn, root): """ Sum .gcov file into counts, then delete it """ - dd = counts.get(sn) - if dd is None: - dd = {} - for ln in open(fn, encoding="UTF-8"): - d = ln.split(":") - cnt = d[0].strip() - ll = d[1] - if cnt == "-": - continue - if cnt == "#####": - cnt = 0 - else: - cnt = int(cnt) - lno = int(d[1]) - if lno not in dd: - dd[lno] = 0 - dd[lno] += cnt - counts[sn] = dd - pl = lengths.get(sn) - ll = ll.strip() - if d[2] == "/*EOF*/\n": - ll = pl - elif pl != ll and not pl is None: - print("CONFLICT", fn, ll, pl) - ll = "-1" - lengths[sn] = ll + + with open(fn, encoding="UTF-8") as gfile: + sline = gfile.readline().split(':') + assert sline[2] == "Source" + sname = os.path.normpath(os.path.join(root, sline[3].strip())) + sfile = source_files.get(sname) + if not sfile: + sfile = SourceFile(sname) + sfile.ingest(gfile) os.remove(fn) def run_gcov(prog, subdir): @@ -109,18 +162,31 @@ def run_gcov(prog, subdir): subdir = root.split("/")[-1] cmd = ["cd " + root + "/.. && " + "exec " + prog + " " + subdir + "/" + fn] rpath = "/../" + elif "vtest2" in root: + cmd = ["cd " + root + "/../.. && " + "exec " + prog + " vtest2/src/" + fn] + rpath = "/../../" + #print("VT2") elif root[-6:] == "/.libs": cmd = ["cd " + root + "/.. && " + "exec " + prog + " .libs/" + fn] rpath = "/../" else: + #print("R", root, "FN", fn) cmd = ["cd " + root + " && " + "exec " + prog + " " + fn] rpath = "/" - x = subprocess.check_output( + sp = subprocess.run( cmd, - stderr=subprocess.STDOUT, shell=True, - universal_newlines=True) - pf = "" + shell=True, + universal_newlines=True, + capture_output=True, + ) + + if sp.returncode != 0 or sp.stderr: + print("CMD", cmd, "EXIT", sp.returncode) + print("SERR", len(sp.stderr), sp.stderr) + print("SOUT", sp.stdout) + sys.exit(2) + x = sp.stdout for ln in x.split("\n"): if "such file" in ln: @@ -129,59 +195,15 @@ def run_gcov(prog, subdir): ln = ln.split() if not ln: continue - if ln[0].find("reating") != -1: + if "reating" in ln[0]: gn = root + rpath + ln[1].strip("'") gn = os.path.normpath(gn) assert gn[-5:] == ".gcov" - sn = gn[:-5] - process_gcov(gn, sn) - -def produce_output(fdo): - """ - Produce compact output file - - Format: - linefm [lineto] count - - "+" in linefm means "previous line + 1" - "." in count means "same as previous count" - """ - - for sn, cnt in counts.items(): - fdo.write("/" + sn + " " + str(lengths[sn]) + "\n") - lnos = list(cnt.items()) - lnos.sort() - pln = -1 - pcn = -1 - while lnos: - ln, cn = lnos.pop(0) - lnl = ln - while lnos: - lnn, cnn = lnos[0] - if lnl + 1 != lnn or cnn != cn: - break - lnos.pop(0) - lnl = lnn - if ln == pln + 1: - s = "+ " - else: - s = "%d " % ln - - if ln != lnl: - s += "%d " % lnl - pln = lnl - else: - pln = ln - - if cn == pcn: - s += "." - else: - s += "%d" % cn - pcn = cn - fdo.write(s + "\n") - -if __name__ == "__main__": + #print("GS", gn) + process_gcov(gn, root) +def main(): + ''' ... ''' optlist, args = getopt.getopt(sys.argv[1:], "g:o:x:") fo = sys.stdout @@ -193,7 +215,7 @@ if __name__ == "__main__": if f == '-o' and v == '-': fo = sys.stdout elif f == '-o': - fo = open(v, "w") + fo = open(v, "w", encoding="utf8") elif f == '-g': gcovprog = v elif f == '-x': @@ -205,4 +227,9 @@ if __name__ == "__main__": for dn in args: run_gcov(gcovprog, dn) - produce_output(fo) + for sf in sorted(source_files.values()): + for i in sf.summary(): + fo.write(i + "\n") + +if __name__ == "__main__": + main() From phk at FreeBSD.org Tue Jun 17 12:42:04 2025 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Tue, 17 Jun 2025 12:42:04 +0000 (UTC) Subject: [master] 16ef0e60c Ifdef on __APPLE__ instead of __DARWIN_BYTE_ORDER Message-ID: <20250617124204.D08ABA784D@lists.varnish-cache.org> commit 16ef0e60cb4caa214fe13f39fd96dd910a796519 Author: Poul-Henning Kamp Date: Tue Jun 17 12:37:14 2025 +0000 Ifdef on __APPLE__ instead of __DARWIN_BYTE_ORDER diff --git a/lib/libvarnish/vsha256.c b/lib/libvarnish/vsha256.c index 29f97fe40..9af3b3039 100644 --- a/lib/libvarnish/vsha256.c +++ b/lib/libvarnish/vsha256.c @@ -31,7 +31,7 @@ #include "config.h" -#ifndef __DARWIN_BYTE_ORDER +#ifndef __APPLE__ # include # ifdef _BYTE_ORDER # define VBYTE_ORDER _BYTE_ORDER From phk at FreeBSD.org Tue Jun 17 12:48:04 2025 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Tue, 17 Jun 2025 12:48:04 +0000 (UTC) Subject: [master] a5bc44c3c Update vtest2 Message-ID: <20250617124804.EF4E6A7D57@lists.varnish-cache.org> commit a5bc44c3c245e9350e20758e196400fd5d3da7e1 Author: Poul-Henning Kamp Date: Tue Jun 17 12:44:31 2025 +0000 Update vtest2 diff --git a/bin/varnishtest/vtest2 b/bin/varnishtest/vtest2 index a5e1d0a58..6a62e4b28 160000 --- a/bin/varnishtest/vtest2 +++ b/bin/varnishtest/vtest2 @@ -1 +1 @@ -Subproject commit a5e1d0a58d6ae87b9c2f5fa8d10bb0880a409c4d +Subproject commit 6a62e4b2823b3751e4eda805bf9990376437d8b5 From nils.goroll at uplex.de Tue Jun 17 12:53:04 2025 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 17 Jun 2025 12:53:04 +0000 (UTC) Subject: [master] d22ca17c3 vmodtool: Complain if the VCS version can not be determined Message-ID: <20250617125304.EBBE5A81B7@lists.varnish-cache.org> commit d22ca17c3987b8cee30013ea7cf07fe66a4e0735 Author: Nils Goroll Date: Tue Jun 17 14:51:39 2025 +0200 vmodtool: Complain if the VCS version can not be determined diff --git a/lib/libvcc/vmodtool.py b/lib/libvcc/vmodtool.py index cd0964ba4..682138e4b 100755 --- a/lib/libvcc/vmodtool.py +++ b/lib/libvcc/vmodtool.py @@ -1248,6 +1248,11 @@ class vcc(): fh.write(gitver) fh.close() + if gitver == "NOGIT": + print("WARNING: Neither git nor vmod_vcs_version.txt found.\n\t" + + " Please build from a git repo or from a dist archive.", + file=sys.stderr) + return gitver def vmod_data(self, fo): From phk at FreeBSD.org Tue Jun 17 21:35:05 2025 From: phk at FreeBSD.org (Poul-Henning Kamp) Date: Tue, 17 Jun 2025 21:35:05 +0000 (UTC) Subject: [master] 09be49f79 Hack to join lib and test counts properly Message-ID: <20250617213505.2199172E9@lists.varnish-cache.org> commit 09be49f79ed07e6a92c48c00fe36c5fbf22db541 Author: Poul-Henning Kamp Date: Tue Jun 17 21:33:32 2025 +0000 Hack to join lib and test counts properly diff --git a/tools/gcov_digest.py b/tools/gcov_digest.py index 309958fba..0e59043ab 100644 --- a/tools/gcov_digest.py +++ b/tools/gcov_digest.py @@ -200,7 +200,7 @@ def run_gcov(prog, subdir): gn = os.path.normpath(gn) assert gn[-5:] == ".gcov" #print("GS", gn) - process_gcov(gn, root) + process_gcov(gn, root.replace("/.libs", "")) def main(): ''' ... ''' From dridi.boukelmoune at gmail.com Thu Jun 19 17:08:06 2025 From: dridi.boukelmoune at gmail.com (Dridi Boukelmoune) Date: Thu, 19 Jun 2025 17:08:06 +0000 (UTC) Subject: [master] e1619abc9 vca: Promote shut_mtx to instrumented lock Message-ID: <20250619170806.1228493C28@lists.varnish-cache.org> commit e1619abc926505a7f6c8db0c2fdc3ff52efbc05c Author: Dridi Boukelmoune Date: Tue Jul 11 09:25:47 2023 +0200 vca: Promote shut_mtx to instrumented lock This would have been a cherry-pick of a commit from #3959, but #3976 introduced many conflicts so I had to reapply it manually. This port was motivated by the curious inclusion of pthread.h that should have happened via a higher-level include in the cache process. Either from cache.h, or indirectly from cache_varnishd.h for internal subsystems. Refs 119832d5e964b01dd672ef6e15f4e2c128bd0c4e It turns out this include is needed because cache_acceptor.h is included from mgt code, which looks like an improvement waiting to happen in that area. The mgt process is single-threaded, so we should really treat the inclusion of pthread.h as a red flag. Switching to an instrumented lock means that mgt code can ignore an opaque struct lock pointer passed to the update() callback, on top of exposing metrics regarding this lock. The encapsulation problem was already registered in an XXX comment in mgt_acceptor.c, and despite this modest improvement, restoring proper mgt/cache boundaries in the listen socket department will require more work. diff --git a/bin/varnishd/acceptor/cache_acceptor.c b/bin/varnishd/acceptor/cache_acceptor.c index 2d6e6350b..57d188644 100644 --- a/bin/varnishd/acceptor/cache_acceptor.c +++ b/bin/varnishd/acceptor/cache_acceptor.c @@ -55,7 +55,7 @@ unsigned pool_accepting; static pthread_t VCA_thread; static vtim_dur vca_pace = 0.0; static struct lock pace_mtx; -static pthread_mutex_t shut_mtx = PTHREAD_MUTEX_INITIALIZER; +static struct lock shut_mtx; /*-------------------------------------------------------------------- * lacking a better place, we put some generic periodic updates @@ -211,7 +211,7 @@ ccf_listen_address(struct cli *cli, const char * const *av, void *priv) while (!pool_accepting) VTIM_sleep(.1); - PTOK(pthread_mutex_lock(&shut_mtx)); + Lck_Lock(&shut_mtx); /* * Varnishtest expects the list of listen sockets to come out in the @@ -223,7 +223,7 @@ ccf_listen_address(struct cli *cli, const char * const *av, void *priv) ls->vca->event(cli, ls, VCA_EVENT_LADDR); } - PTOK(pthread_mutex_unlock(&shut_mtx)); + Lck_Unlock(&shut_mtx); } /*--------------------------------------------------------------------*/ @@ -240,6 +240,7 @@ VCA_Init(void) CLI_AddFuncs(vca_cmds); Lck_New(&pace_mtx, lck_vcapace); + Lck_New(&shut_mtx, lck_vcashut); VCA_Foreach(vca) { CHECK_OBJ_NOTNULL(vca, ACCEPTOR_MAGIC); @@ -252,14 +253,14 @@ VCA_Shutdown(void) { struct acceptor *vca; - PTOK(pthread_mutex_lock(&shut_mtx)); + Lck_Lock(&shut_mtx); VCA_Foreach(vca) { CHECK_OBJ_NOTNULL(vca, ACCEPTOR_MAGIC); vca->shutdown(); } - PTOK(pthread_mutex_unlock(&shut_mtx)); + Lck_Unlock(&shut_mtx); } /*-------------------------------------------------------------------- diff --git a/bin/varnishd/acceptor/cache_acceptor.h b/bin/varnishd/acceptor/cache_acceptor.h index 3815b8289..11f143a22 100644 --- a/bin/varnishd/acceptor/cache_acceptor.h +++ b/bin/varnishd/acceptor/cache_acceptor.h @@ -36,6 +36,7 @@ struct listen_sock; struct listen_arg; struct pool; +struct lock; void VCA_Init(void); void VCA_Start(struct cli *cli); @@ -54,7 +55,7 @@ typedef void acceptor_start_f(struct cli *); typedef void acceptor_event_f(struct cli *, struct listen_sock *, enum vca_event); typedef void acceptor_accept_f(struct pool *); -typedef void acceptor_update_f(pthread_mutex_t *); +typedef void acceptor_update_f(struct lock *); typedef void acceptor_shutdown_f(void); struct acceptor { diff --git a/bin/varnishd/acceptor/cache_acceptor_tcp.c b/bin/varnishd/acceptor/cache_acceptor_tcp.c index af2ceda90..8efac3694 100644 --- a/bin/varnishd/acceptor/cache_acceptor_tcp.c +++ b/bin/varnishd/acceptor/cache_acceptor_tcp.c @@ -552,14 +552,14 @@ vca_tcp_accept(struct pool *pp) } static void -vca_tcp_update(pthread_mutex_t *shut_mtx) +vca_tcp_update(struct lock *shut_mtx) { struct listen_sock *ls; if (!vca_tcp_sockopt_init()) return; - PTOK(pthread_mutex_lock(shut_mtx)); + Lck_Lock(shut_mtx); VTAILQ_FOREACH(ls, &TCP_acceptor.socks, vcalist) { CHECK_OBJ_NOTNULL(ls, LISTEN_SOCK_MAGIC); @@ -581,7 +581,7 @@ vca_tcp_update(pthread_mutex_t *shut_mtx) ls->test_heritage = 1; } - PTOK(pthread_mutex_unlock(shut_mtx)); + Lck_Unlock(shut_mtx); } static void diff --git a/bin/varnishd/acceptor/cache_acceptor_uds.c b/bin/varnishd/acceptor/cache_acceptor_uds.c index 75462416b..d67f552a5 100644 --- a/bin/varnishd/acceptor/cache_acceptor_uds.c +++ b/bin/varnishd/acceptor/cache_acceptor_uds.c @@ -495,14 +495,14 @@ vca_uds_accept(struct pool *pp) } static void -vca_uds_update(pthread_mutex_t *shut_mtx) +vca_uds_update(struct lock *shut_mtx) { struct listen_sock *ls; if (!vca_uds_sockopt_init()) return; - PTOK(pthread_mutex_lock(shut_mtx)); + Lck_Lock(shut_mtx); VTAILQ_FOREACH(ls, &UDS_acceptor.socks, vcalist) { CHECK_OBJ_NOTNULL(ls, LISTEN_SOCK_MAGIC); @@ -524,7 +524,7 @@ vca_uds_update(pthread_mutex_t *shut_mtx) ls->test_heritage = 1; } - PTOK(pthread_mutex_unlock(shut_mtx)); + Lck_Unlock(shut_mtx); } static void diff --git a/include/tbl/locks.h b/include/tbl/locks.h index 773c31ffa..2199270e2 100644 --- a/include/tbl/locks.h +++ b/include/tbl/locks.h @@ -48,6 +48,7 @@ LOCK(conn_pool) LOCK(dead_pool) LOCK(vbe) LOCK(vcapace) +LOCK(vcashut) LOCK(vcl) LOCK(vxid) LOCK(waiter) From dridi.boukelmoune at gmail.com Thu Jun 19 17:08:06 2025 From: dridi.boukelmoune at gmail.com (Dridi Boukelmoune) Date: Thu, 19 Jun 2025 17:08:06 +0000 (UTC) Subject: [master] e9a3ddc09 Revert "Add missed include" Message-ID: <20250619170806.259BC93C2B@lists.varnish-cache.org> commit e9a3ddc0913ff3cd80e2e4cef6558900143f919f Author: Dridi Boukelmoune Date: Wed Jun 11 09:11:05 2025 +0200 Revert "Add missed include" This reverts commit 119832d5e964b01dd672ef6e15f4e2c128bd0c4e. It should no longer be needed now that the acceptor's shutdown mutex is an instrumented lock. diff --git a/bin/varnishd/acceptor/cache_acceptor.h b/bin/varnishd/acceptor/cache_acceptor.h index 11f143a22..33065f5bc 100644 --- a/bin/varnishd/acceptor/cache_acceptor.h +++ b/bin/varnishd/acceptor/cache_acceptor.h @@ -30,8 +30,6 @@ * */ -#include - /* cache_acceptor.c */ struct listen_sock; struct listen_arg; From dridi.boukelmoune at gmail.com Thu Jun 19 17:08:06 2025 From: dridi.boukelmoune at gmail.com (Dridi Boukelmoune) Date: Thu, 19 Jun 2025 17:08:06 +0000 (UTC) Subject: [master] 0f1b1c031 mgt: Avoid needless cache_acceptor.h includes Message-ID: <20250619170806.532C393C30@lists.varnish-cache.org> commit 0f1b1c0318077002c7a0e9f77845ab291eb2a778 Author: Dridi Boukelmoune Date: Wed Jun 11 09:11:37 2025 +0200 mgt: Avoid needless cache_acceptor.h includes We don't need a complete struct acceptor definition to satisfy mgt_acceptor.h declarations. diff --git a/bin/varnishd/acceptor/mgt_acceptor.h b/bin/varnishd/acceptor/mgt_acceptor.h index ed9d4354d..d61088577 100644 --- a/bin/varnishd/acceptor/mgt_acceptor.h +++ b/bin/varnishd/acceptor/mgt_acceptor.h @@ -43,6 +43,8 @@ struct listen_arg { const struct uds_perms *perms; }; +struct acceptor; + void VCA_Add(struct acceptor *); void VCA_Config(void); diff --git a/bin/varnishd/mgt/mgt_child.c b/bin/varnishd/mgt/mgt_child.c index ae08c54e6..149926797 100644 --- a/bin/varnishd/mgt/mgt_child.c +++ b/bin/varnishd/mgt/mgt_child.c @@ -47,7 +47,6 @@ #include #include "mgt.h" -#include "acceptor/cache_acceptor.h" #include "acceptor/mgt_acceptor.h" #include "vapi/vsig.h" diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c index 933a9d93a..3aab45395 100644 --- a/bin/varnishd/mgt/mgt_main.c +++ b/bin/varnishd/mgt/mgt_main.c @@ -47,7 +47,6 @@ #include #include "mgt/mgt.h" -#include "acceptor/cache_acceptor.h" #include "acceptor/mgt_acceptor.h" #include "common/heritage.h" From dridi.boukelmoune at gmail.com Fri Jun 20 08:07:07 2025 From: dridi.boukelmoune at gmail.com (Dridi Boukelmoune) Date: Fri, 20 Jun 2025 08:07:07 +0000 (UTC) Subject: [master] 67bc0aee4 mgt: Typo in pthread.h (un)safety net Message-ID: <20250620080707.9AF1876E1@lists.varnish-cache.org> commit 67bc0aee4b0531350217e438886b8730c6805c16 Author: Dridi Boukelmoune Date: Fri Jun 20 10:04:33 2025 +0200 mgt: Typo in pthread.h (un)safety net I was trying to add a safety net to catch pthread usage in MGT code and eventually ran into this. Unfortunately, it didn't catch the pthread.h inclusion from #4231, because it happened in a header file included after mgt.h and in general we should avoid including anything from header files, letting C files include everything needed. This is at least the model for functions like getaddrinfo(): netdb.h does not include sys/types.h and sys/socket.h on our behalf. I'm not sure how to formalize this check beyond a rule to remember during code reviews. I said in #4346 that I'd like to add a build-time check but it already exists and for now the only way to uphold it is discipline. diff --git a/bin/varnishd/mgt/mgt.h b/bin/varnishd/mgt/mgt.h index 2610aaf75..b99b96e22 100644 --- a/bin/varnishd/mgt/mgt.h +++ b/bin/varnishd/mgt/mgt.h @@ -248,7 +248,7 @@ extern const char *mgt_vcl_path; extern const char *mgt_vmod_path; #if defined(PTHREAD_CANCELED) || defined(PTHREAD_MUTEX_DEFAULT) -#error "Keep pthreads out of in manager process" +#error "Keep pthreads out of the manager process" #endif #define MGT_FEATURE(x) COM_FEATURE(mgt_param.feature_bits, x) From dridi.boukelmoune at gmail.com Mon Jun 23 06:01:05 2025 From: dridi.boukelmoune at gmail.com (Dridi Boukelmoune) Date: Mon, 23 Jun 2025 06:01:05 +0000 (UTC) Subject: [master] 54658d108 Update increasing-your-hitrate.rst: Fix typo Message-ID: <20250623060105.203F5A7F98@lists.varnish-cache.org> commit 54658d108eec288bc07fef18d099ecfb6e9e090b Author: jemaltz Date: Mon Jun 23 08:29:10 2025 +0300 Update increasing-your-hitrate.rst: Fix typo diff --git a/doc/sphinx/users-guide/increasing-your-hitrate.rst b/doc/sphinx/users-guide/increasing-your-hitrate.rst index 72fd2f544..65f56001e 100644 --- a/doc/sphinx/users-guide/increasing-your-hitrate.rst +++ b/doc/sphinx/users-guide/increasing-your-hitrate.rst @@ -44,7 +44,7 @@ request. ``varnishlog -q 'ReqURL ~ "^/foo/bar"'`` will show you the requests coming from the client matching `/foo/bar`. For more information on how :ref:`varnishlog(1)` works please see -:ref:`users-guide-logging` or then man page. +:ref:`users-guide-logging` or the man page. Tool: lwp-request From dridi.boukelmoune at gmail.com Mon Jun 23 15:02:05 2025 From: dridi.boukelmoune at gmail.com (Dridi Boukelmoune) Date: Mon, 23 Jun 2025 15:02:05 +0000 (UTC) Subject: [master] 37040b4d8 mgt: Add an intentional conflict with pthread.h Message-ID: <20250623150205.EB08863857@lists.varnish-cache.org> commit 37040b4d83e865718a1ec1429c46d1f97bc9efbc Author: Dridi Boukelmoune Date: Fri Jun 20 18:05:52 2025 +0200 mgt: Add an intentional conflict with pthread.h If the macro check is not enough, this one hopefully catches stragglers. Suggestion from @asadsa92. Refs #4346 diff --git a/bin/varnishd/mgt/mgt.h b/bin/varnishd/mgt/mgt.h index b99b96e22..146ed69a6 100644 --- a/bin/varnishd/mgt/mgt.h +++ b/bin/varnishd/mgt/mgt.h @@ -251,6 +251,13 @@ extern const char *mgt_vmod_path; #error "Keep pthreads out of the manager process" #endif +static inline void +pthread_create(void) +{ + + WRONG("Intentional conflict with pthread.h"); +} + #define MGT_FEATURE(x) COM_FEATURE(mgt_param.feature_bits, x) #define MGT_EXPERIMENT(x) COM_EXPERIMENT(mgt_param.experimental_bits, x) #define MGT_DO_DEBUG(x) COM_DO_DEBUG(mgt_param.debug_bits, x) From dridi.boukelmoune at gmail.com Tue Jun 24 07:52:05 2025 From: dridi.boukelmoune at gmail.com (Dridi Boukelmoune) Date: Tue, 24 Jun 2025 07:52:05 +0000 (UTC) Subject: [master] 63d6f3f2b vtest2: Plug empty h2 header value leak Message-ID: <20250624075205.E5165487D@lists.varnish-cache.org> commit 63d6f3f2b56658b09df1a39c6498722ac30e100d Author: Dridi Boukelmoune Date: Tue Jun 24 09:22:24 2025 +0200 vtest2: Plug empty h2 header value leak diff --git a/bin/varnishtest/vtest2 b/bin/varnishtest/vtest2 index 6a62e4b28..4cffb5a3c 160000 --- a/bin/varnishtest/vtest2 +++ b/bin/varnishtest/vtest2 @@ -1 +1 @@ -Subproject commit 6a62e4b2823b3751e4eda805bf9990376437d8b5 +Subproject commit 4cffb5a3c49e270305c20fc9824a213193ef26af From nils.goroll at uplex.de Tue Jun 24 11:22:05 2025 From: nils.goroll at uplex.de (Nils Goroll) Date: Tue, 24 Jun 2025 11:22:05 +0000 (UTC) Subject: [master] 7f7b030bf flexelinting Message-ID: <20250624112205.829DD65820@lists.varnish-cache.org> commit 7f7b030bfbe61857bc9c398ec238bbe280cb0df8 Author: Nils Goroll Date: Tue Jun 24 13:19:09 2025 +0200 flexelinting seen outside tree with less warnings suppressed Info 747: Significant prototype coercion (arg. no. 1) int to unsigned long diff --git a/include/miniobj.h b/include/miniobj.h index f794bf389..dd6f0ca9d 100644 --- a/include/miniobj.h +++ b/include/miniobj.h @@ -25,14 +25,14 @@ #define ALLOC_OBJ(to, type_magic) \ do { \ - (to) = calloc(1, sizeof *(to)); \ + (to) = calloc((size_t)1, sizeof *(to)); \ if ((to) != NULL) \ (to)->magic = (type_magic); \ } while (0) #define ALLOC_OBJ_EXTRA(to, extra_size, type_magic) \ do { \ - (to) = calloc(1, sizeof(*(to)) + (extra_size)); \ + (to) = calloc((size_t)1, sizeof(*(to)) + (extra_size)); \ if ((to) != NULL) \ (to)->magic = (type_magic); \ } while (0) @@ -42,7 +42,7 @@ #define ALLOC_FLEX_OBJ(to, fld, len, type_magic) \ do { \ - (to) = calloc(1, SIZEOF_FLEX_OBJ(to, fld, len)); \ + (to) = calloc((size_t)1, SIZEOF_FLEX_OBJ(to, fld, len));\ if ((to) != NULL) \ (to)->magic = (type_magic); \ } while (0)