diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-09-15 22:14:56 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-09-15 22:14:56 +0200 |
commit | 31bbf1ba735cbeff5640424d5d0c06a94614764d (patch) | |
tree | 0829b201b69c7c9fadd9b8519fe0c4393bf81033 | |
parent | 89c9711bfe4429b9fa67f80448f59644e15f8ba4 (diff) |
detect alternative memory allocators and quit early
-rw-r--r-- | mutrace.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -35,6 +35,7 @@ #include <sys/syscall.h> #include <unistd.h> #include <sys/prctl.h> +#include <malloc.h> /* FIXMES: * @@ -221,6 +222,15 @@ static void setup(void) { if (initialized) return; + if (__malloc_hook) { + fprintf(stderr, + "mutrace: Detected non-glibc memory allocator. Your program uses some\n" + "mutrace: alternative memory allocator (jemalloc?) which is not compatible with\n" + "mutrace: mutrace. Please rebuild your program with the standard memory\n" + "mutrace: allocator or fix mutrace to handle yours correctly.\n"); + real_exit(1); + } + t = hash_size; if (parse_env("MUTRACE_HASH_SIZE", &t) < 0 || t <= 0) fprintf(stderr, "mutrace: WARNING: Failed to parse $MUTRACE_HASH_SIZE.\n"); |