From 0f9a10c7f1c207288c48a1dc3d71285219a762cd Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 12 Sep 2023 17:29:57 +0200 Subject: [PATCH] DEBUG: pools: also print the value of the tag when it doesn't match Sometimes the tag's value may reveal a recognizable pattern, so let's print it when it doesn't match a known pool. --- src/pool.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/pool.c b/src/pool.c index f4b99a432..37c848544 100644 --- a/src/pool.c +++ b/src/pool.c @@ -967,7 +967,10 @@ void pool_inspect_item(const char *msg, struct pool_head *pool, const void *item the_pool = pool; } else { - chunk_appendf(&trash, "Tag does not match. Possible origin pool(s):\n"); + if (!may_access(pool_mark)) + chunk_appendf(&trash, "Tag not accessible. "); + else + chunk_appendf(&trash, "Tag does not match (%p). ", tag); list_for_each_entry(ph, &pools, list) { pool_mark = (const void **)(((char *)item) + ph->size); @@ -976,6 +979,9 @@ void pool_inspect_item(const char *msg, struct pool_head *pool, const void *item tag = *pool_mark; if (tag == ph) { + if (!the_pool) + chunk_appendf(&trash, "Possible origin pool(s):\n"); + chunk_appendf(&trash, " tag: @%p = %p (%s, size %u, real %u, users %u)\n", pool_mark, tag, ph->name, ph->size, ph->alloc_sz, ph->users); if (!the_pool || the_pool->size < ph->size) @@ -984,7 +990,7 @@ void pool_inspect_item(const char *msg, struct pool_head *pool, const void *item } if (!the_pool) - chunk_appendf(&trash, " none found.\n"); + chunk_appendf(&trash, "Tag does not match any other pool.\n"); } }