This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] malloc: Deprecate hook variables, __default_morecore, <mcheck.h>


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]