BUG/MEDIUM: pools/memprofile: always clean stale pool info on pool_destroy()
authorWilly Tarreau <w@1wt.eu>
Thu, 21 Nov 2024 10:30:03 +0000 (11:30 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 22 Nov 2024 14:49:51 +0000 (15:49 +0100)
commitcd587f2b488550dd33c79d91144b0d19ef1127ae
tree9b65a0e2a0560ab76a22bf31262dc5b26a2a2985
parent3b5cfb28e1549a4f67cda6a1d336817f71e7f491
BUG/MEDIUM: pools/memprofile: always clean stale pool info on pool_destroy()

There's actually a problem with memprofiles: the pool pointer is stored
in ->info but some pools are replaced during startup, such as the trash
pool, leaving a dangling pointer there, that may randomly report crap or
even crash during "show profile memory".

Let's make pool_destroy() call memprof_remove_stale_info() added
by previous patch so that these entries are properly unregistered.

This must be backported along with the previous patch (MINOR:
activity/memprofile: offer a function to unregister stale info) as
far as 2.8.

(cherry picked from commit ed3ed358676edf058663bde7ec6098b51f8bc745)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/pool.c