]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: stats: fix crash on 'dump stats-file' quic-interop flx04/quic-interop
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 24 Apr 2026 13:58:42 +0000 (15:58 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 24 Apr 2026 14:04:21 +0000 (16:04 +0200)
A crash occurs immediately when stats-file dump is requested by the
command-line. The issue is caused by the introduction of watchers when
iterating over the proxies list, which is now required with dynamic
backends.

  commit 20376c54e2166a0882b71b26326360786f79ebdb
  MINOR: stats: protect proxy iteration via watcher

The above patch initializes the new proxy watcher for stats dump and
HTML. However, this was forgotten for stats-file command context. Fix
this by adding the missing watcher_init() in cli_parse_show_stat().

No need to backport.

src/stats.c

index 09c3b1a08178f2055cbaf69061bc7bfb3314d79f..3c143c27d761cbd4a4aa56424009a76193b4437c 100644 (file)
@@ -1057,6 +1057,7 @@ static int cli_parse_dump_stat_file(char **args, char *payload,
        ctx->domain = STATS_DOMAIN_PROXY;
        ctx->flags |= STAT_F_FMT_FILE;
        watcher_init(&ctx->srv_watch, &ctx->obj2, offsetof(struct server, watcher_list));
+       watcher_init(&ctx->px_watch,  &ctx->obj1, offsetof(struct proxy, watcher_list));
 
        return 0;
 }