From: Willy Tarreau Date: Fri, 12 Apr 2024 13:56:18 +0000 (+0200) Subject: DEBUG: pool: improve decoding of corrupted pools X-Git-Tag: v3.0-dev8~63 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b21aaef4e582758d085a59984d33901e74983a18;p=thirdparty%2Fhaproxy.git DEBUG: pool: improve decoding of corrupted pools When a corruption was detected in an object, it's often said that the tag doesn't match the pool, but it should also check if it matches the location of an earlier pool_free() call, which happens when -dMcaller is used. That's what we're doing now. --- diff --git a/src/pool.c b/src/pool.c index ccee8c4bef..65751b0dc3 100644 --- a/src/pool.c +++ b/src/pool.c @@ -1016,9 +1016,16 @@ void pool_inspect_item(const char *msg, struct pool_head *pool, const void *item if (!the_pool) { const char *start, *end, *p; + chunk_appendf(&trash, + "Tag does not match any other pool.\n"); + pool_mark = (const void **)(((char *)item) + pool->size); + if (resolve_sym_name(&trash, "Resolving the tag as a pool_free() location: ", *pool_mark)) + chunk_appendf(&trash, "\n"); + else + chunk_appendf(&trash, " (no match).\n"); + chunk_appendf(&trash, - "Tag does not match any other pool.\n" "Contents around address %p+%lu=%p:\n", item, (ulong)((const void*)pool_mark - (const void*)item), pool_mark);