glibc.malloc.check: Wean away from malloc hooks
commitb5bd5bfe88f496463ec9fab680a8edf64d7c2a42
authorSiddhesh Poyarekar <siddhesh@sourceware.org>
Thu, 22 Jul 2021 13:08:08 +0000 (22 18:38 +0530)
committerSiddhesh Poyarekar <siddhesh@sourceware.org>
Thu, 22 Jul 2021 13:08:08 +0000 (22 18:38 +0530)
tree51978efe075143c64fcd622b051faa49572928db
parent9dad716d4d2993f50b165747781244bd7c43bc95
glibc.malloc.check: Wean away from malloc hooks

The malloc-check debugging feature is tightly integrated into glibc
malloc, so thanks to an idea from Florian Weimer, much of the malloc
implementation has been moved into libc_malloc_debug.so to support
malloc-check.  Due to this, glibc malloc and malloc-check can no
longer work together; they use altogether different (but identical)
structures for heap management.  This should not make a difference
though since the malloc check hook is not disabled anywhere.
malloc_set_state does, but it does so early enough that it shouldn't
cause any problems.

The malloc check tunable is now in the debug DSO and has no effect
when the DSO is not preloaded.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
41 files changed:
malloc/Makefile
malloc/Versions
malloc/arena.c
malloc/hooks.c
malloc/malloc-check.c
malloc/malloc-debug.c
malloc/malloc.c
sysdeps/aarch64/Makefile
sysdeps/mach/hurd/i386/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/aarch64/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/alpha/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/arc/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/arm/be/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/arm/le/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/csky/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/hppa/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/i386/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/ia64/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/m68k/coldfire/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/m68k/m680x0/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/microblaze/be/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/microblaze/le/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/mips/mips32/fpu/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/mips/mips64/n32/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/mips/mips64/n64/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/nios2/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/riscv/rv32/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/riscv/rv64/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/s390/s390-32/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/s390/s390-64/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/sh/be/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/sh/le/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/sparc/sparc32/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/sparc/sparc64/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/x86_64/64/libc_malloc_debug.abilist
sysdeps/unix/sysv/linux/x86_64/x32/libc_malloc_debug.abilist