From 58912b8d92c161bf7226e791d5727857dbfcd51d Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 22 Mar 2023 15:47:51 +0100 Subject: [PATCH] MINOR: tools: relax dlopen() on malloc/free checks Now that we can provide a safe malloc_trim() we don't need to detect anymore that some dependencies use a different set of malloc/free functions than ours because they will use the same as those we're seeing, and we control their use of malloc_trim(). The comment about the incompatibility with DEBUG_MEM_STATS is not true anymore either since the feature relies on macros so we're now OK. This will stop catching libraries linked against glibc's allocator when haproxy is natively built with jemalloc. This was especially annoying since dlopen() on a lib depending on jemalloc() tends to fail on TLS issues. --- src/tools.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/tools.c b/src/tools.c index a4572b9..8001b8d 100644 --- a/src/tools.c +++ b/src/tools.c @@ -6078,8 +6078,6 @@ void *dlopen(const char *filename, int flags) const char *name; void *curr, *next; } check_syms[] = { - { .name = "malloc", }, - { .name = "free", }, { .name = "SSL_library_init", }, { .name = "X509_free", }, /* insert only above, 0 must be the last one */ @@ -6100,7 +6098,7 @@ void *dlopen(const char *filename, int flags) /* save a few pointers to critical symbols. We keep a copy of both the * current and the next value, because we might already have replaced - * some of them (e.g. malloc/free with DEBUG_MEM_STATS), and we're only + * some of them in an inconsistent way (i.e. not all), and we're only * interested in verifying that a loaded library doesn't come with a * completely different definition that would be incompatible. */ -- 1.7.10.4