This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] malloc: Deprecate hook variables, __default_morecore, <mcheck.h>
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Tue, 15 Nov 2016 15:39:05 +0000
- Subject: Re: [PATCH] malloc: Deprecate hook variables, __default_morecore, <mcheck.h>
- Authentication-results: sourceware.org; auth=none
- References: <20161026150218.3F1A4439942E0@oldenburg.str.redhat.com> <alpine.DEB.2.20.1610261548400.23075@digraph.polyomino.org.uk> <11f59117-e5a4-4c62-739c-e05e01ee43b3@redhat.com>
On Tue, 15 Nov 2016, Florian Weimer wrote:
> In my opinion, the larger ecosystem already provides suitable replacements.
>
> * <mcheck.h> and all malloc hook functions are now deprecated. Future
> implementations of the mcheck- and mtrace-related functions will not
> have any effect, and glibc will stop calling the hook functions from
> its malloc implementation. Instead of mcheck and mtrace, developers
> should consider using valgrind. As a replacement for the hook
> functions, developers can interpose their own malloc implementation.
I don't consider valgrind suitable for replacing the uses of mtrace in the
glibc testsuite (or other similar uses elsewhere for lightweight checking
for leaks). It's massively more heavyweight, has limited architecture
support, as far as I know can only be built with an installed glibc and I
don't know if there are other complications building it in a bootstrap
environment. Whereas a simple preloadable interposing malloc
implementation provided with glibc could support the mtrace functionality
as well as providing an example for people writing interposing
implementations to use.
I don't know enough about the functionality GDB expects from linking with
-lmcheck by default in development to know whether other malloc
improvements would provide similar checking by default or whether that
would also need GDB to provide its own malloc (again, I think valgrind is
vastly too heavyweight for using by default in GDB development).
--
Joseph S. Myers
joseph@codesourcery.com