]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: pools: use %u not %d to report pool stats in "show pools"
authorWilly Tarreau <w@1wt.eu>
Wed, 6 May 2020 15:10:37 +0000 (17:10 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 13 May 2020 08:10:54 +0000 (10:10 +0200)
In dump_pools_to_trash() we happen to use %d to display unsigned ints!

This has probably been there since "show pools" was introduced so this
fix must be backported to all versions. The impact is negligible since
no pool uses 2 billion entries. It could possibly affect the report of
failed allocation counts but in this case there's a bigger problem to
solved!

src/memory.c

index 551ca83ea09e8e22fae9587addb6abac05c634e9..5db2c35ea805cc23355e4f28e6b5f2f05d6f80cd 100644 (file)
@@ -486,7 +486,7 @@ void dump_pools_to_trash()
 #ifndef CONFIG_HAP_LOCKLESS_POOLS
                HA_SPIN_LOCK(POOL_LOCK, &entry->lock);
 #endif
-               chunk_appendf(&trash, "  - Pool %s (%d bytes) : %d allocated (%u bytes), %d used, %d failures, %d users, @%p=%02d%s\n",
+               chunk_appendf(&trash, "  - Pool %s (%u bytes) : %u allocated (%u bytes), %u used, %u failures, %u users, @%p=%02d%s\n",
                         entry->name, entry->size, entry->allocated,
                         entry->size * entry->allocated, entry->used, entry->failed,
                         entry->users, entry, (int)pool_get_index(entry),