mcheck: Wean away from malloc hooks [BZ #23489]
commitc142eb253f3814f46527e9b37484041dd85702cf
authorSiddhesh Poyarekar <siddhesh@sourceware.org>
Thu, 22 Jul 2021 13:08:02 +0000 (22 18:38 +0530)
committerSiddhesh Poyarekar <siddhesh@sourceware.org>
Thu, 22 Jul 2021 13:08:02 +0000 (22 18:38 +0530)
treeee11b3299370d97ca570aecebdae9f1f54debaaf
parent2d2d9f2b48a943fa556301db532103d09800da4d
mcheck: Wean away from malloc hooks [BZ #23489]

Split the mcheck implementation into the debugging hooks and API so
that the API can be replicated in libc and libc_malloc_debug.so.  The
libc APIs always result in failure.

The mcheck implementation has also been moved entirely into
libc_malloc_debug.so and with it, all of the hook initialization code
can now be moved into the debug library.  Now the initialization can
be done independently of libc internals.

With this patch, libc_malloc_debug.so can no longer be used with older
libcs, which is not its goal anyway.  tst-vfork3 breaks due to this
since it spawns shell scripts, which in turn execute using the system
glibc.  Move the test to tests-container so that only the built glibc
is used.

This move also fixes bugs in the mcheck version of memalign and
realloc, thus allowing removal of the tests from tests-mcheck
exclusion list.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
41 files changed:
include/mcheck.h
malloc/Makefile
malloc/Versions
malloc/hooks.c
malloc/malloc-debug.c
malloc/mcheck-impl.c [copied from malloc/mcheck.c with 62% similarity]
malloc/mcheck.c
posix/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