mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 17:17:06 +02:00
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.
This commit is contained in:
parent
859341c1ec
commit
ed3ed35867
@ -946,6 +946,9 @@ void *pool_destroy(struct pool_head *pool)
|
|||||||
/* note that if used == 0, the cache is empty */
|
/* note that if used == 0, the cache is empty */
|
||||||
free(pool->base_addr);
|
free(pool->base_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* make sure this pool is no longer referenced in memory profiling */
|
||||||
|
memprof_remove_stale_info(pool);
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user